SPD workflow task using existing site columns

Creating workflows with SharePoint Designer 2010 is easy, especially when compared with SPD 2007. One of the new cool features is the ability to create task processes. The task process editor creates a task content type behind the scenes, complete with a task form (InfoPath file) and site columns linked to it. When a user fills this form, the data in the fields that are linked to the site columns is saved in the related task list.

I encountered a bizarre problem while working with this editor. I was working on a project that had to be very portable so I created site columns in advance via a feature so that they would be identical in all the environments (same GUIDs.) When I tried to use these site columns in the task process I could see them in the task form but the data entered just wouldn't get saved.

Here's the explanation, and a possible solution.

This is the interface for adding fields to the task process:
task form fields

When you press the New... button a new site column is created. Its static name always starts with "FieldName_", no matter what display name you give it. The column then gets added to the task form as a field and data entered to it gets saved in the task list.
So far so good, everything works as expected.

Now, you'd expect that pressing the Choose existing field button would let you associate the task form with an existing site column. That is not entirely the case.
What happens is that the column is associated with the form and users can enter data into it, but the data is saved to the task list only if the site column's static name starts with "FieldName_". Apparently there's something in the page that hosts the task form (WrkTaskIP.aspx) that saves the field only if it starts with "FieldName_".

Sadly I could not find a solution to this problem. I had to create my site columns with a static name that starts with "FieldName_" instead of a normal name.

Print Friendly and PDF


Manoj75 said...

good article, solved my issue

Purvish said...

solved my issue thanx. How did you find the solution?

Post a Comment