This topic contains 1 reply, has 0 voices, and was last updated by ANE3 7 years, 3 months ago.

  • Author
    Posts
  • #10309 Score: 0

    n.tiwari@manduka.com
    • Contributions: 0
    • Level 1

    Hi,

    I have two custom PO approval workflows – each of them gets triggered when one uses a specific custom PO form to enter the PO.

    So, if a user uses Expense PO form to enter PO then it will trigger the Expense PO Approval workflow.

    And if a user uses a Item PO form to enter PO then it will trigger the Item PO Approval workflow.

    The problem happens when someone enters a PO using the Expense PO form when they actually wanted to enter an Item PO. So, they switch the form from Expense PO to Item PO form and I noticed the Expense PO workflow stays in addition to the Item PO workflow.

    The Expense PO workflow does not get canceled automatically and we have to manually it.

    I was wondering if we can auto-cancel an existing workflow somehow if the record go in another workflow?

    Or if there is any better way to handle this use case?
    This is a cached copy. Click here to see the original post.

  • #10310 Score: 0

    ANE3
    • Contributions: 0
    • Level 1

    I assume this is a large workflow, I am also assuming that It’s sitting at a particular point in your flow waiting to go to the next state or a particular piece of logic to be met. You need to make sure that your states have proper termination that account for the user action on the custom form field.

    What I’d explore is firstly creating a boolean on the expense workflow that is by default set to false. Have a set field value action on the state where your workflow is getting stuck, have this trigger on before field edit where the trigger condition to check if the custom form fields value is something you don’t want it to be (for example the item form) with the condition set, go ahead and have this state set the field value of the field on the workflow to true.

    Now create a transition that triggers on before load and evaluates if this field is set to true, as when you change form on the page, this forces a reload allowing you to use that to transition your workflow, have this transition connect to an empty state that ends the workflow.

    Hope this helps

You must be logged in to reply to this topic.