0
votes

enter image description here

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

enter image description here

1

1 Answers

0
votes

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