I would like to access the sharepoint "workflow information" of an item so that I can get the "status" and the "Last run" programmatically. Can anyone show me how can I get the values from these fields "Status" and "Last run"?
thanks a lot
you can access workflow history of an item in "Workflow History" list.
from the list you can filter tasks related to a specific item/list and workflow association.
(by using listid, itemid, workflowassociationid)
To get workflow associationid:
SPWorkflowAssociation assoc = myList.WorkflowAssociations.GetAssociationByName("MyWFNameInEnglish",System.Globalization.CultureInfo.GetCultureInfo(1033));
The "last run" value can be obtained by getting the "Modified" date of the latest task.
The Status of the workflow can be decoded from the "Event" field.
You can find a list of the meanings for the Event values here
PS: you can use sharepoint manager to navigate through properties of a List/Web/etc. and U2U CAML query builder to have a deeper look into the data inside the lists
Related
In a to-do list where users have both system-created items and their own items, how would you store the items?
A to-do list can have a mix of items. The system-created items can be modified and deleted just like user-created items. There difference is the titles and description text for the system-created items are initially pulled from a configuration. Many users can have the same system-created items. E.g. if two users want to paint rooms in their houses, they'd both get "buy paint" items.
Option 1
Save the full system-created items (including the title & text) with the user-created items.
Pros: Flexibility for user modifications since the items belong to the user and are not dependent on a central item configuration.
Cons: Lots of redundancy because there will be many users all with the same items.
Option 2
Save references to a configuration for system-created items with the user-created items.
Pros: Flexibility for system modifications since if we want to say "buy X-brand paint" instead of "buy paint", the change is easily reflected for all users with this item.
Cons: System-created items have to persist forever in the configuration even if the item is no longer relevant for new to-do lists because otherwise the user's reference will be broken.
Other options?
Thank you!
My initial thought is - what is your requirement? Your user-flows and project road-map might contain information to inform your design.
From your question "system-created items can be modified and deleted just like user-created items":
This indicates that you are going to have to have a way to track modifications to your 'system-created' templates per user or convert them to 'user-created' messages when they are edited.
This is more complexity than you seem to need
It seems much simpler to create messages from system templates, then have them be regular messages.
A bit of extra storage is not going to break the bank
You have not mentioned any case where you would need to operate over only system-created to-do's. But in this case, you could include created-by metadata.
I think the key here is whether you need to be able to modify a "system todo", and that change to be reflected in all the "user todos"...
If that's a requirement (it sounds sensible to me), your only option is Option 2 - the real con of Option 1 is once you copied the "system todo" as a "user todo", you cannot tell anymore whether they're related...
I'd go for a model similar to this, with 2 entities/tables:
ToDoTemplate
Integer id
String name
String description
ToDoItem
Integer id
ToDoTemplate template
Boolean completed = false
?String name = null
?String description = null
When you create a ToDoItem, you create it based on a ToDoTemplate (it may be a blank template), and you set the name and description as null, reusing the template name/description... Only if the user modifies their own ToDoItem is when you store that value... i.e.
String getName() {
return this.name != null ? this.name : this.template.name;
}
This is the most flexible of the approaches, and the only valid in many situations... Note the con you mention:
Cons: System-created items have to persist forever in the configuration even if the item is no longer relevant for new to-do lists because otherwise the user's reference will be broken.
This is not a con really - as long as there's one ToDoItem that uses a given ToDoTemplate, the template is still relevant, and of course there's no reason to remove it...
I am working on building a REST API based connector to a marketplace which uses sitecore. I have found the documentation for using the search API command here:
https://sdn.sitecore.net/upload/sitecore6/65/sitecore_search_and_indexing_sc60-65-a4.pdf
I have been unable to figure out how to use it to search for content that is grouped into a navigation category, and was unsure if there was a good way to do this. I did not design the site, and the designers were contractors who are no longer working with us.
I would like to be able to find a list of items based on a specific navigation category that has been assigned to them. I have tried getting the children of the category ID itself, but that did not work. Here is a picture of the navigation category associated with a given object in case it adds clarification:
enter image description here
Is there an easy way to search for items like this?
Going with the assumption that you are on 7.2 or above, you just need to search for items that have the ID of the Navigation Categorization field (in your index as navigation_categorization) that are set to the ID of the item you wish to filter on. In your image, it would be the ID of "connectivity services" item.
var context = ContentSearchManager.GetIndex("master").CreateSearchContext();
var computedLanguage = Sitecore.Context.Language.CultureInfo.Name;
// get the iBuild items
var results = context.GetQueryable<SearchResultItem>()
.Where(i => i["navigation_categorization"].Contains([connectivity services ID])
&& i.Language == computedLanguage)
.GetResults()
.Hits.Select(x => x.Document.GetItem(
));
How can we filter a lookup that is in a page of the dialog process.
E.g. I have a lookup to "incident" on Prompt and Response, I would like to filter it based on the value of a field in incident entity.
I tried:
Creating new views, also setting it as default.
addPreSearch and addCustomFilter on the field on the form(Not sure how to use these scripts inside the Dialog)
Any Ideas ?
Thanks you
Unfortunately this is not possible.
As an alternative you could consider adding a query to the dialog and a page with a prompt having an Option Set (picklist) response type.
I have a scenario where I have two Similar looking tags "Project N" and "Project Name". There is a custom grid (Defect) that has a query thats intended for "Project N" but also catches "Project Name" what is the best way to exclude "Project Name" when im looking for "Project N"
Sample Query
(((Requirement.Tags.Name contains "Project N") AND (State < "Closed")) AND (Tags.Name !contains "Project N"))
I don't have a set of tags in a similar situation to test with, but it seems like if you change the !contains to "Name" it should get just the "Project N" tagged items, without getting the "Project Name" tagged items.
(((Requirement.Tags.Name contains "Project N") AND (State < "Closed")) AND (Tags.Name !contains "Project Name"))
That should find all of the items that are tagged as "Project N" and with a state less than closed, and which are not tagged with something with "Project Name". - However, if the items that are tagged with "Project N" are also tagged with "Project Name" or are also tagged another tags such as "Project Name - Condor", it will exclude those items. ... I am not sure there is a way to get around that with the custom grid; I think you would need to create a custom report to avoid that situation, though I could be wrong.
I have setup the same set of tags and tested the same query string however I am not running into the same issue. I tried:
(((Requirement.Tags.Name contains "Project N") AND (State < "Closed")) AND (Tags.Name !contains "Project N"))
My query is excluding the User Story with the 'Project Name' tag as desired.
If this is still not working for you I would suggest you open a case with Rally Support using the Contact Support link at the bottom of any page in Rally.
My application is complete and work perfectly for Products.
Like i have an "application link" in the Products tab.On clicking, i get the SHOP name and ID of that product.Then i can successfully call the API because
GET /admin/products/#{id}/XXXX.json
by default i had use the "products" in path resolution.
Now the question is, at first I only got the ID with query parameter but don't know from which resource_type this belongs? i.e pages,themes etc.
Answer to this problem is that "you can append parameters to your query string" in Application Links.