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

Posted by ybbest on YBBest See other posts from YBBest or by ybbest
Published on Thu, 30 May 2013 04:56:00 +0000 Indexed on 2013/06/24 16:40 UTC
Read the original article Hit count: 472

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)


© YBBest or respective owner

Related posts about SharePoint 2013

Related posts about SharePoint Designer