Sometime you create a Workflow (WF) and you don’t want it to redirect to the initial list where it was started from.
But rather to a Display Form or an Edit Form of the record that triggered the WF.
Let’s see how to redirect a workflow to a different page after starting.
1. In the style sheet create a parameter that will contain the URL of the form to which to redirect to :
<xsl:variable name=”RedirectDisp“>../../Lists/YourList/DispForm.aspx?ID=<xsl:value-of select=”$Id“/></xsl:variable>
Where $ID is the ID of the list item
2. Then change the start button from the WF page :
<td nowrap=”nowrap” class=”ms-vb”>
<input type=”button” value=”Start” name=”btnSave” onclick=”javascript: {ddwrt:GenFireServerEvent(concat(‘__insert;__commit;__redirectsource;__redirectToList={‘,ddwrt:EcmaScriptEncode($ListName),’};‘))}” />
</td>
To
<td nowrap=”nowrap” class=”ms-vb”>
<input type=”button” value=”Start” name=”btnSave” onclick=”javascript: {ddwrt:GenFireServerEvent(concat(‘__insert;__commit;__redirect={‘,$RedirectDisp,’}‘))}” />
</td>
That’s it.
Thanks Man you are a life saver!!!!
Thanks for very useful post! A small typo in the text, It meant <xsl:value-of select=
Very many thanks !!! Successful…
What/where is the stylesheet you are editing to create the parameter?
Thanks
Hi David,
When you open the SharePoint Designer, you select the respective WorkFlow you want this to be changed.
When you open the WF you will come into the WF Settings Page.
Where you can see the WF Information sections, the Start options section etc.
Just below the Start Options Section you see the FORMS section.
This is where the landing page is of the WF. By default this is an ASPX page, that has the same name as the WF.
Open this page in Advanced Mode.
That’s where you need to make the changes.
I hope this will put you on track 😉
Hi – Thanks, but in the Forms section that is below the Start Options section there is an .xsn file not an ASPX… btw I’m using SharePoint 2010 ..please advise
Hi – Thanks, but in the Forms section that is below the Start Options section there is an .xsn file that I cannot open.. btw I’m using SharePoint 2010 ..please advise
Reblogged this on Sutoprise Avenue, A SutoCom Source.