Home › Forums › Classic DFFS › Button To Start Workflow?
- This topic has 11 replies, 4 voices, and was last updated 8 years, 9 months ago by Bloodlvst.
-
AuthorPosts
-
-
February 26, 2016 at 19:44 #10451
Hey everyone,
I’ve had success previously with creating a button on my forms which sets a certain field to a value and saves the list item all in one click, which triggers a workflow based on the value.
However, I’m wondering if anyone knows of any way where if I have a workflow enabled to be started manually, if a button in a list item can be set to start the workflow on that item?
Thanks in advance for any help! 🙂
-
March 1, 2016 at 10:59 #10498
Hi Kyle,
There’s a lot of useful resources out there to do with Workflows.
Can you provide more detail on what exactly you require?Do you mean a button in a calculated column that triggers a workflow for that specific item?
-
March 1, 2016 at 23:55 #10526
Hi,
I have never tried it, but if you look at the source code for the workflow page, the code on the “start” button calls this function (obviously with different GUIDS in your setup):StartWorkflow4('ab064e56-926c-477b-910e-0d3759f5b956', '6', '{CBFF19E4-3959-49D6-B393-8252A7FBC8A9}')
This function (and a few more) is in the page source, but I’m not sure including it in the custom js textare will do the trick as it might have other requirements.
Alexander
-
March 2, 2016 at 18:02 #10545
@Brett – No this would just be a normal HTML button that does a JS function on click.
@Alex – Thanks for this, I thought it might be related to that, just was unsure if there was a better way. I’ll experiment with this today and let you know if I find something that does this so other users can use this if possible 🙂
-
March 3, 2016 at 13:24 #10582
I looked at it, and her is a working example: https://spjsblog.com/2016/03/03/dffs-start-sp2013-workflow-from-a-button-in-a-list-item/
Alexander
-
March 7, 2016 at 16:09 #10641
Wow Alex,
This is incredible. And it actually works! I tried to get it to work on my end but couldn’t, then I just now noticed the email saying you replied and you have a working solution!
Beer has been sent your way for this one! 🙂
Thanks so much!
-
March 7, 2016 at 16:14 #10643
Thank you for the beer!
Alexander
-
-
March 3, 2016 at 18:45 #10587
Thank you so much Alexander! That was so helpful! Beers will be sent promptly – I truly appreciate your promptness!
A couple notes:
I found that I had a few syntax errors (lagging “;”) that needed to be removed.
This could have been my ignorance – but you leave the JS piece exactly how it is on the blog post, the only thing you have to put your subscriptionID into is the HTML field on the tab.-
March 3, 2016 at 21:02 #10597
Hi,
Thank you for the beer!I’m not sure I understand what you mean by the syntax errors – is there a problem with my code example? – if so, I could add it here as an attachment.
Best regards,
Alexander
-
-
March 7, 2016 at 20:06 #10661
I just noticed this doesn’t seem to be working for a few Sharepoint 2010 workflows we’re using. Is that a limitation of this method, that it can only be used with Sharepoint 2013 workflows?
-
March 9, 2016 at 16:31 #10704
Hi,
I seems the SP 2010 workflow is initiated using different code. You are redirected to “/_layouts/15/IniWrkflIP.aspx”, and it seems all code is in the page source. Maybe this code can be wrapped up in a custom function like the one I created form SP 2013 workflows.Unfortunately I’m a bit busy and cannot dive into this now.
Alexander
-
March 14, 2016 at 20:09 #10755
No worries Alex! I’ll try to work around it and/or see if we’re able to convert the workflows to 2013 Workflows. 🙂
-
-
AuthorPosts
- You must be logged in to reply to this topic.