SharePoint – Redirect Workflow Page after starting

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

image
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>

image

That’s it.

8 Responses to SharePoint – Redirect Workflow Page after starting

  1. Thanks Man you are a life saver!!!!

  2. Nikita says:

    Thanks for very useful post! A small typo in the text, It meant <xsl:value-of select=

  3. Wendell Alves says:

    Very many thanks !!! Successful…

  4. David says:

    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 😉

      • David says:

        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

      • David says:

        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

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.