Page 1 of 1
Start workflow OnClick event
Posted: 03 Sep 2014
by Adam Reyes
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}
Re: Start workflow OnClick event
Posted: 04 Sep 2014
by Dmitry Kozlov
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
Re: Start workflow OnClick event
Posted: 04 Sep 2014
by Adam Reyes
That worked! Dmitry THANK YOU! You are the man!
Re: Start workflow OnClick event
Posted: 15 Jun 2015
by mac_xpert
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!
Re: Start workflow OnClick event
Posted: 16 Jun 2015
by Dmitry Kozlov
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.