Implementing a state machine workflow project on a SharePoint 2010 Document Library (i will do a full post soon), I faced a situation where I wanted to pass data from the workflow instance to the ASP.NET task edit form.
Before I have many times done the reverse: passing data from the Task Edit forms to the workflow instance by defining custom content types and referencing their fields inside my workflow using the ExtendedProperties Hashtable.
So now I thought I could do the same to pass data into my task form: from inside the wf instance I used the ExtendedProperties hashtable to set a value to my field when creating the task as follows:
task.ExtendedProperties[“myItemGUID”] = “…..”;
Now in the task form i tried to access the same property using:
mytaskListItem.Properties[“myItemGUID”] but it is always null.
I then “watched” over the Xml property of mytaskListItem and found that “myItemGUID” was actually populated inside as follows:
ows_ExtendedProperties = ‘ows_myItemGUID=……’
Further if I use mytaskListItem.GetFormattedValue(“ows_ExtendedProperties”) i can get the same value “ows_myItemGUID=…” where parsing will be easier than having to parse the full Xml value.
Now of course this will make me move on for now, but this is hardly an optimum solution. Till now I do not know why I could not “strongly-type get” the value of the field the same way I can do when getting data from the wf instance…Needless to say, SharePoint is not exactly my thing (so far!)…workflows are 🙂 so I could be missing some SharePoint related stuff…anyway will get back to this once I finish the business process…