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.

Advertisements

7 Responses to Redirect Workflow Page after starting

  1. 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

  2. Wendell Alves says:

    Very many thanks !!! Successful…

  3. Nikita says:

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

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: