Hello,
I'm writing some code in a K2 custom server event through K2 for Visual Studio. In the code below, I've found that I can easily write to K2.ProcessInstance.DataFields, but that I can't seem to read from the DataFields.
//Set date submitted
K2.ProcessInstance.DataFields["Date Submitted"].Value = DateTime.Now.ToShortDateString();
//Get Document Attributes
LogMessageToFile("Doc ID from DataFields = " + K2.ProcessInstance.DataFields["Doc ID"].Value.ToString());
The Date Submitted is correctly set and I can read from it later through the K2 interface. The message logged to my text log file shows a blank in the place of the Doc ID value. I know the Doc ID has a value b/c I also am writing the Doc ID to a column at another step and can see the correct value in the column on my SharePoint site.
Has anyone else seen this behavior, or am I missing a step?
Thanks,
Kim