Subscribe
E-mail
Download View Codeplex Project Site
Powered by: newtelligence dasBlog 1.9.7174.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Rich Finn
dasBlog MOSS template
Here's how you can programatically get the workflow history for a given workflow instance on an SPListItem. The data returned is the same seen on the Wokflow Status page.
Microsoft.SharePoint.Workflow.SPWorkflow workflow = spListItem.Workflows[0];//0 is most recent SPList historyList = workflow.HistoryList; string notesQuery = "<Where><Eq><FieldRef Name=\"WorkflowInstance\"/><Value Type=\"Text\">" + workflow.InstanceId.ToString() + "</Value></Eq></Where>"; SPQuery qHistory = new SPQuery(); qHistory.Query = notesQuery; SPListItemCollection historyItems = historyList.GetItems(qHistory);