Start workflow OnClick event

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
Adam Reyes
Posts: 35
Joined: Tue Mar 04, 2014

03 Sep 2014

I created a form where I created a button on the Display Form that needs to start a workflow but I'm having trouble building a url that pulls in the item ID. What can I use in FormsDesigner or Javascript that will pull in the correct ID then launch the workflow? I'm currently using this:

window.open('https://www.somesite.com/_layouts/15/In ... x','_blank');



I attempted to use the following but could not get it to pull in the ID:

&ID={ID}
&ID=[ID]
&ID=('ID')
&ID={@ID}

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

04 Sep 2014

Hello Adam,

Please, try the following code:

Code: Select all

window.open('https://www.somesite.com/_layouts/15/IniWrkflIP.aspx?List={cb84a83a-dd06-4190-9471-ddec67a0465c}&ID=' + [b]GetUrlKeyValue[/b]('ID') + '&ItemGuid={03607538-5743-46AE-A792-A453F0D1E3D8}&TemplateID={e6fa6347-030a-4403-a77f-44d18cb059de}&Source=https%3A%2F%2Fwww%2Esomesite%2Ecom%2FLists%2FDisputes%2FDisputes

User avatar
Adam Reyes
Posts: 35
Joined: Tue Mar 04, 2014

04 Sep 2014

That worked! Dmitry THANK YOU! You are the man!

mac_xpert
Posts: 13
Joined: Thu Sep 18, 2014

15 Jun 2015

Please can you provide an example of how to get this code? I'd like to run a sharepoint 2013 workflow from a button in sharepoint designer display form, but can't figure it out.


Many thanks!

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

16 Jun 2015

Hi,

There are a lot of samples on how to start a workflow via JavaScript:

https://ericgregorich.com/2014/10/01/20 ... avascript/

So, you only need to insert the correct code into OnClick property of the HyperLink control. Our support team can help you with the task. It will take 200 support minutes.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests