When you publish workflow in SharePoint Designer and workflow contains some task activity, it generates custom task form. Generated form shows only task fields and link to related item. It means one extra click for users to see related item. How to show related item right on the task form?
- Move custom task form (DataFormWebPart) into new WebPartZone
<WebPartPages:WebPartZone ID="MainZone" runat="server" Title="Main Zone"><ZoneTemplate>
...
</ZoneTemplate></WebPartPages:WebPartZone> - Add new WebPartZone for related item
<WebPartPages:WebPartZone ID="ItemZone" runat="server" Title="Item Zone"><ZoneTemplate>
...
</ZoneTemplate></WebPartPages:WebPartZone> - Add column WorkflowItemId to DataSource of task. Find <datafields> element of <DataFormWebPart> and add
@WorkflowItemId,Workflow Item ID;
- Add WorkflowItemId as a new row to table in task DataFormWebPart (it will be used later for webpart connection)
<tr>
<td width="25%" class="ms-formlabel">
<b>Workflow Item ID:</b>
</td>
<td width="75%" class="ms-formbody">
<xsl:value-of select="@WorkflowItemId" />
</td>
</tr> - Add Custom List Form - Display Form of related item
- Create WebPart Connection
- Change ParameterBinding of ListItemId in related item DataFormWebPart from QueryString to Connection
<ParameterBinding Name="ListItemId" Location="Connection" DefaultValue="0"/>
- Now you can hide Workflow Item ID table row
<tr style="display:none">
No comments:
Post a Comment