Thursday, January 14, 2010

Using ASPX as a workflow task form

First of all thanks to Robert Shelton who wrote a very good workshop on how to use aspx forms for all Assocciation,Initaion, and Task Edit form .
The Issue I were facing is how to pass data from the workfolow to the task form and then how to read them.
First there is no problem passing the data from the workflow by using the ExtendeProperties
MyTask.TaskProperties.ExtendedProperties["Comments"] = "Hellow";
but the problem is how to read them from the aspx form.
First I decided to the ExtendedProperties for the task as will by calling this method
HashTable extendedProp = SPWorkflowTask.GetExtendedPropertiesAsHashTable(myTaskAsListIetm);
but the returned collection is always empty, after some searches I found that when I create a new content type for the Task List the workflow will not automatically create an ExtendedProperties.
Then I tried to access the data as ordiniary properties Like this
label1.Text = myTaskAsListItem["Comments"].ToString();
and this worked fine for me.

Happy Coding.
Thanks

1 comment:

  1. Hey, sherif:) I follow your blog regularly because I'm rather a newbie in this field, Do you have like a basic FAQ or something, for beginners?

    ReplyDelete