I have searched around the internet and there is no simple way found until I came up on a few comments in different blogs. I decided to write my own version.
//Option 1 void WriteToHistoryList(string comment, string outcome) { SPWorkflow.CreateHistoryEvent(workflowProperties.Web, this.WorkflowInstanceId, 0, workflowProperties.Web.CurrentUser, new TimeSpan(), outcome, comment,"" ); } //Option 2</pre> void LogToHistoryList(ActivityExecutionContext executionContext, string msg) { ((ISharePointService)executionContext.GetService(typeof(ISharePointService))).LogToHistoryList(base.WorkflowInstanceId, SPWorkflowHistoryEventType.WorkflowComment, 0, new TimeSpan(), string.Empty, msg, string.Empty); } <pre>
Posted by sandy on January 16, 2014 at 9:39 AM
i was actually looking for this. piece of info.
this is nice and is working.. thanks
Posted by Ravi Ranjan Karn on August 7, 2014 at 6:02 AM
Reblogged this on Ravi Ranjan Karn.
Posted by Sending debug messages in sequential workflow | DL-UAT on January 9, 2015 at 4:42 AM
[…] http://msdn.microsoft.com/en-us/library/ff798337.aspx https://alrickdev.wordpress.com/2012/04/22/programmatically-writing-to-workflow-history-list-sharepo… […]
Posted by Sending debug messages in sequential workflow – Best Leaf Space on July 8, 2017 at 10:21 AM
[…] msdn.microsoft.com/en-us/library/ff798337.aspx Programmatically writing to workflow history list. Sharepoint 2010 […]