משיב מוביל

Need help with SharePoint Designer 2010 workflow and custom columns

שאלה

I am using SharePoint 2010 Server and customising approval workflows using SharePoint Designer 2010. There is a requirement to display additional information to the authorising users as part of the approval process, i.e. on the 'Workflow Task' screen, before
they press [Approve] / [Reject] buttons.

I have created a custom site column to hold our information, created a reusable workflow, customised the approval workflow, declared my custom column in the 'task form fields' section, set the value in 'Change the behaviour of a single task' -->
Before a Task is Assigned and then assigned the workflow to my list. I have two problems:

1) Whilst the custom column and its value is displayed correctly on the list view, the "Workflow Task" screen just shows an empty field. Please see the screenshot below.

2) How can I customise the way the Workflow Task screen displays 'My Custom Column' value? I need to be able to display the data as a hyperlink using our custom URL handler. On the list itself I have done this by modifying the ASPX page for my view and changed
the xsl:template, but I can't find a similar option for the Workflow Task Form.

תשובות

I can reproduce your issue .When Add a site column as a task form field ,the field cannot be updated using the ‘Update Task Field ’ action .It can be updated using rules in InfoPath designer .

After you publish the reusable workflow ,the workflow will have an initiation form and a task form .

Click on the Approval Workflow Task_x0028-en-US_x0029.xsn to open it in InfoPath designer .

Click on the Data tab and choose Form load to add form load rules .

Set the action as Set a field value .Set the site column to get the value as you want (if the value is retrieved from other lists ,you can add data connections to retrieve data from SharePoint list ).

Another thing to mention is that if you create new task form field instead of adding existing site columns ,the data can be correctly set on task forms .If you want to data to display as a hyperlink ,you can add a new task form field of ‘Hyperlink or picture’
information type .Format the URL as hyperlink .

כל התגובות

I can reproduce your issue .When Add a site column as a task form field ,the field cannot be updated using the ‘Update Task Field ’ action .It can be updated using rules in InfoPath designer .

After you publish the reusable workflow ,the workflow will have an initiation form and a task form .

Click on the Approval Workflow Task_x0028-en-US_x0029.xsn to open it in InfoPath designer .

Click on the Data tab and choose Form load to add form load rules .

Set the action as Set a field value .Set the site column to get the value as you want (if the value is retrieved from other lists ,you can add data connections to retrieve data from SharePoint list ).

Another thing to mention is that if you create new task form field instead of adding existing site columns ,the data can be correctly set on task forms .If you want to data to display as a hyperlink ,you can add a new task form field of ‘Hyperlink or picture’
information type .Format the URL as hyperlink .

1) Creating a new Task Form Field as you pointed out instead of choosing an existing site column solves part of the issue, i.e. I can see the value displayed on the "Workflow Task" InfoPath form. However, it introduces another issue as follows:

We are going to run a number of different approval workflows against items from the same list. If I create a new Task Form Field in every workflow I end up with multiple list columns in my target list and the information I need to display to the users is
scattered around different columns. See the screenshot below.

Isn't there any way to get the Site Columns to work somehow from the SPD? This would also give us consistency accross different workflows. Note the users only need to see the information. They don't need to update it.

The second approach you suggested, setting values using load actions in infopath sounds a bit complex for the audience we are targeting.

2) The problem with a hyperlink column is that it only works with standards protocols. I am using a custom URL protocol handler. See the second screenshot below.

Is it possible to achieve the same on the Workflow Task InfoPath form?

I believe I have solved the first problem. The trick is to initially create my Site Columns using the "Task Form Fields" section of the workflow editor. Once the site columns are created this way, they can be used in other workflows and set using the "Set
Task Field" action in the workflow designer. Values then get displayed correctly in both the SharePoint list and on the Workflow Task approval form. The only inconvenience is the field name SharePoint assigns to these fields, e.g. FieldName_E7F3EC0D_4839_42DD_A93,
which makes it much harder to work with in the code. Anyway, this is not a big issue. It would be useful to know why there is such a difference between Site Columns created directly (SPD --> Site Columns --> New Column) and Site Columns created from
the workflow editor.

Would appreciate your help with the 2nd issue raised earlier, i.e. display the field as custom hyperlink on the Workflow Task form.