Monthly Archives: April 2015

Programmatically complete a workflow task

To complete a workflow task programmatically, use the following code (say taskItem is the task you want to complete): taskItem.Web.AllowUnsafeUpdates = true; Hashtable data = new Hashtable(); data[SPBuiltInFieldId.Completed] = “TRUE”; data[SPBuiltInFieldId.PercentComplete] = 1; data[SPBuiltInFieldId.Outcome] = “Completed”; data[SPBuiltInFieldId.TaskStatus] = SPResource.GetString(new CultureInfo((int)taskItem.Web.Language, … Continue reading

Posted in SharePoint 2010, Visual Studio 2010 | Tagged , | Leave a comment