Start workflow OnClick event
Posted by Adam Reyes - Sep 3 ’14 at 04:20
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/IniWrkflIP.aspx?List={cb84a83a-dd06-4190-9471-ddec67a0465c}&ID=1388&ItemGuid={03607538-5743-46AE-A792-A453F0D1E3D8}&TemplateID={e6fa6347-030a-4403-a77f-44d18cb059de}&Source=https%3A%2F%2Fwww%2Esomesite%2Ecom%2FLists%2FDisputes%2FDisputes%2Easpx','_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}
-
Dmitry KozlovAdminMember for: 6 years 2 months 21 days
Hello Adam,
Please, try the following code:
window.open('https://www.somesite.com/_layouts/15/IniWrkflIP.aspx?List={cb84a83a-dd06-4190-9471-ddec67a0465c}&ID=' + GetUrlKeyValue('ID') + '&ItemGuid={03607538-5743-46AE-A792-A453F0D1E3D8}&TemplateID={e6fa6347-030a-4403-a77f-44d18cb059de}&Source=https%3A%2F%2Fwww%2Esomesite%2Ecom%2FLists%2FDisputes%2FDisputes%2Easpx','_blank');
-
Adam ReyesMemberMember for: 5 years 8 months 9 days
[#1]: That worked! Dmitry THANK YOU! You are the man!
-
mac_xpertMemberMember for: 5 years 2 months 24 days
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!
-
Dmitry KozlovAdminMember for: 6 years 2 months 21 days
[#3]: Hi,
There are a lot of samples on how to start a workflow via JavaScript:
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.