Button To Start Workflow?

Forums Classic DFFS Button To Start Workflow?

Viewing 8 reply threads
  • Author
    Posts
    • #10451
      Bloodlvst
      Participant

      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! 🙂

    • #10498
      Brett
      Participant

      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?

    • #10526
      Alexander Bautz
      Keymaster

      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

    • #10545
      Bloodlvst
      Participant

      @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 🙂

    • #10582
      Alexander Bautz
      Keymaster
      • #10641
        Bloodlvst
        Participant

        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!

      • #10643
        Alexander Bautz
        Keymaster

        Thank you for the beer!

        Alexander

    • #10587
      Melissa Hamilton
      Participant

      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.

      • #10597
        Alexander Bautz
        Keymaster

        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

    • #10661
      Bloodlvst
      Participant

      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?

    • #10704
      Alexander Bautz
      Keymaster

      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

    • #10755
      Bloodlvst
      Participant

      No worries Alex! I’ll try to work around it and/or see if we’re able to convert the workflows to 2013 Workflows. 🙂

Viewing 8 reply threads
  • You must be logged in to reply to this topic.