Start workflow OnClick event

rss

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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #1 by Dmitry Kozlov Sep 4 ’14 at 03:07

    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 Reyes
    Adam Reyes
    Member
    Member for: 5 years 8 months 9 days
    #2 by Adam Reyes Sep 4 ’14 at 12:21

    [#1]: That worked!  Dmitry THANK YOU!  You are the man!

  • mac_xpert
    Member
    Member for: 5 years 2 months 24 days
    #3 by mac_xpert Jun 15 ’15 at 10:01

    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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 21 days
    #4 by Dmitry Kozlov Jun 16 ’15 at 11:09

    [#3]: Hi,

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

    http://www.ericgregorich.com/blog/2014/10/1/starting-a-sharepoint-2013-workflow-programmatically-using-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.

Displaying 1 to 4 of 4 messages