This one was a little hard to track down. How do you write directly to the SharePoint workflow history? It’s easy enough to add a LogToHistory activity and set the HistoryDescription and HistoryOutcome, but what if you want to create those entries dynamically?
After toying around with different ways of trying this, the answer was pretty easy:
Here’s the code sample:
SPMember usermember = workflowProperties.OriginatorUser;
SPWorkflow.CreateHistoryEvent(this.workflowProperties.List.ParentWeb,
this.workflowId,
0,
usermember,
TimeSpan.MinValue,
“Corp Legal Reviewed”,
“Status Change”,
string.Empty);
Very good day! I know this is somewhat off topic but I was questioning in case you knew exactly where I could locate a captch plugin for my comment form? Im using exactly the same weblog platform as yours and Im having trouble finding one? Thanks a whole lot!
Nice post!
zee
http://walisystems.com
Best tip ever! Thanks!
You’re welcome.
Good one… exactly what i was looking for, thanks much!
can you do this without code?
No, unfortunately this does require code. There may be a way in an SP Designer workflow, but I usually work through Visual Studio workflows.