Thursday, April 15, 2010

Programmatically update workflow history on specific list

using (SPSite site = new SPSite("http://MOSS:5858"))

{

using (Microsoft.SharePoint.SPWeb web = site.OpenWeb())

{



web.AllowUnsafeUpdates = true;

SPList historyList = web.Lists["Workflow History"];

SPListItem item = historyList.Items.Add();



item["Description"] = "testing";

item["WorkflowInstance"] = "{7CF46B1F-42C8-4E0A-80D3-EBEFD670AC63}";



item.Update();

}

}