Wednesday, July 6, 2011

Programmatically start workflow

Steven Van de Craen's Blog - Programmatically start workflow: "Guid wfBaseId = new Guid('{6BE0ED92-BB12-4F8F-9687-E12DC927E4AD}');
SPSite site = ...;
SPWeb web = site.OpenWeb();
SPList list = web.Lists['listname'];
SPListItem item = list.Items[0];
SPWorkflowAssociation associationTemplate= list.WorkflowAssociations.GetAssociationByBaseID(wfBaseId);
site.WorkflowManager.StartWorkflow(item, associationTemplate, '');"

No comments: