Home > SharePoint 2013, SharePoint designer > How to display workflow related tasks in the item display page where the workflow is currently running on in SharePoint2013

How to display workflow related tasks in the item display page where the workflow is currently running on in SharePoint2013

In one of the project, I need to display workflow related tasks in the item display page where the workflow is currently running on. To achieve this, I’d like to add the tasks list view web part and using the connected web part to achieve this.(ID=workflowitemid)

However, to make it work I need to unhide the workflowitemid field in the task list, as it is hidden field and also cantogglehidden field is set to false. I need to use reflection to change the cantogglehidden field to true as it only has getter in the API and then I am able to unhide the field. You can download the script here. However, it is not ideal (make your environment not supported by Microsoft) to display tasks this way.

Another way to display the related task is to use SharePoint designer solution with List view web part and data source. Here are the steps.

1. Create a new list display form as below

2. Edit the custom display form in advanced mode.

3. Find the PlaceHolderMain contentplace hoder and insert the DataView by choosing the associated workflow tasks list as below

4. Go to the List View Tools >> OPTIONS

5. Create a Parameter called workflowitemId Parameter which retrieve the value from the ID querystring as below

6. Create a filter based on UIVersion = workflowitemId as below ,we are going to change the UIVersion to WorkflowItemId property later as WorkflowItemId is a hidden field and cannot be selected from the wizard.

7. Replace UIVersion with WorkflowItemId in the caml for the XsltListViewWebPart.

From:

TO

8. Go to the new custom display page at http://yourserver/Lists/aa/CustomDisplayPage.aspx?ID=414, you will see the associated tasks are showing in the page.

References:

http://office.microsoft.com/en-us/sharepoint-designer-help/watch-this-design-a-document-review-workflow-solution-HA010256417.aspx (Video 12 and 13)

Advertisements
  1. Joe Mills
    November 22, 2013 at 10:19 pm

    That works for me on 2010 – thanks for posting

  2. James
    July 2, 2014 at 4:08 am

    This didn’t work for me. It was fine until I changed the FieldRef Name from _UIVersion to WorkflowItemId. When I did that and saved the form, I got an error:

    soap:ServerException of type ‘Microsoft.SharePoint.SoapServer.SoapServerException’ was thrown.One or more field types are not installed properly. Go to the list settings page to delete these fields.0x81020014

    Any ideas?

  3. Doo Lee
    January 7, 2015 at 1:08 pm

    James,

    You won’t get the error if you use the exact same names – workflowitemId and WorkflowItemId (case-sensitive).

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: