Monday, May 19, 2008

How to work with extended properties in Tasks List

Hi All,

workflow tasks lists is built in list which works tightly with Create Task, update Task and complete Task activity of workflow foundation. Setting several properties to these activites assignes task to user, update tasks of user and also removes tasks from user task list.

These all actions are taken care automatically.

Several times you still require that columns are not enough for your information in tasks list, you may require to store some additional data in that list. you can ofcourse create column through front end or from code, but assigning values to that columns (fields) is not stright forward process.

When you are adding your own fields in pre-defined list then these fields are actually called "Extended Properties", so you need to take care while assigning the values to these fields.

Here is the way you can accomplish this task.

private void createTask(object sender, EventArgs e)
{
taskID = Guid.NewGuid();
taskProps.Title = "Demo Task";
taskProps.AssignedTo = assignee;
taskProps.Description = instructions;
taskProps.ExtendedProperties["comments"] = comments;
taskProps.ExtendedProperties["instructions"] = instructions;
}


Here is a create task bolck, But Comments and instructions are two more columns added. Values for these columns can be inserted as shown above.

For more information : Click Here

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com