Workflows

MBClarkeMBClarke Member Posts: 71
Hi,

I have an issue with the workflows that have me confused and I cannot seem to find any solution for this issue. The scenario is as follows;

We have 1 workflow that is setup under sales, MS-SOAPW where we have set certain criteria for this workflow. It is a custom field on our Sales Order for Gross Profit percent, and if the GP% on the order falls below 33% it triggers this workflow. This works just fine. But then doesnt trigger any other workflow if other criteria fail.

Example: Workflow MS-SOAPW-02 is for the Gross Profit <33% send for approval.
Workflow MS-SOCLAPW-01 for Sales Orders when the Customer has exceeded their Credit Limit.

We create a Sales Order that is below our Gross Profit percentage as well as over the credit limit. The Gross Profit workflow is triggered, they then approve the order, the order is released instead of triggering the Credit Limit workflow afterwards. Now the Order is released, the warehouse pick the product and ship, even though the customer is over is credit limit.

Is there a way to get past this or to have one workflow trigger another? I am not a developer so please respond as a consultant. If development is needed, I will have our developer figure out your possible solutions.

I did try combine both workflows into one, but that failed.

Thanks in advance

Malcolm
«13

Answers

  • MBClarkeMBClarke Member Posts: 71
    edited 2020-09-17
    Anyone have a solution to this issue?
  • AluanAluan Member Posts: 158
    edited 2020-08-17
    Hello MBClarke,
    what version are you using?

    For NAV 2018 there was a fix for "The workflow sequence does not trigger correctly." (Maybe that is the problem)
    See here: https://support.microsoft.com/en-us/help/4518533/cumulative-update-21-for-microsoft-dynamics-nav-2018-build-35815
  • MBClarkeMBClarke Member Posts: 71
    Thanks Aluan, they are on NAV 2018 so will see if the hotfix will sort this out.
  • MBClarkeMBClarke Member Posts: 71
    Hi all, The hotfix didnt work to solve this. Does anyone have any other ideas on what could be the issue and how to resolve?

    Thank you
  • MBClarkeMBClarke Member Posts: 71
    Does anyone have any idea on this issue? I cannot find anything online. We have tested this extensively but cannot figure out how to get this to work.

    Please can someone assist or point me in the right direction?

    Thanks,
    Malcolm
  • AluanAluan Member Posts: 158
    What exactly should happen when the Credit Limit is Exceeded?

    If we take your example:
    You create a Sales Order -> Trigger for Gross Profit is executed -> Approval is approved.

    So now, you could create a Workflow for the Approval. For example:
    last Approval is approved -> Check if customer credit limit is exceeded
    if limit is exceeded -> do something
    if limit is not exceeded -> set the status to released

    Maybe you can send a screenshot of the workflow you are using. So i can rebuild it =)
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Thank you for your response. What should happen is that the workflow should check to see if the GP is over their limit, if so then go for approval, if not, then do nothing, and then it should trigger the credit limit workflow. If that fails, send it for approval, if it passes, do nothing.

    The person that approves for the first GP workflow is different to the person that approves for credit limit approvals, this is why I have 2 approvals setup. I think the issue is that my GP workflow states, when approved, release the document, which it should rather trigger another workflow, but I have no idea how to do that as I am not a developer and it seems my developers are struggling to figure this out.

    Attached is a screen shot my two workflows.

    Thanks
    Malcolm
  • AluanAluan Member Posts: 158
    edited 2020-09-21
    Hello,
    the following should work. You need maybe modify it a bit.

    jn7ej33vh6g6.png

    The "A customer credit limit is execeded". Looks like:
    l3g4s0yhx07k.png
    I inserted here a User Group, for the approval.
    alt62orfrlsd.png

    You can add a few more lines for your requirements. (Multiple approver, Approval is rejected)

    You need to set a Table Releation in the setup. (Workflow - Table Relations), that should work:
    vpkkvsl6chgk.png
  • MBClarkeMBClarke Member Posts: 71
    Thanks again Aluan. I seem to still be struggling with this. Is it possible to export your workflow for me so I can try import it in mine and work from there?

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    I used the available export function. (Page 1500 - Workflows) Since in can't upload a ".xml" file, i posted it at pastebin.
    -> https://pastebin.com/7GjqDEHL

    You just need to copy the Paste Data and paste it into the texteditor and save it as ".xml". After that you should be able to import it, with the available Import function.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan, Stuggling to import your workflow for the text file.

    I have mine setup very similar to yours, only difference is that I never set mine to an approval group, but a specific approver for both options...but it just doesn't work.

    My workflow is attached again. As said the only difference I have is that I did not set a group for the credit limit but a specific approver.

    Thanks,
    Malcolm

  • AluanAluan Member Posts: 158
    Are you getting an error for the import?
    Can you show me the Response of the second line (An approval request is approved.)? There should be a line with "Check if the customer credit limit is exceeded."

    If the import is not working, i can write a step by step "guide".

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Thank you for all your assistance. I have amended my Response to include the 'Check if Customer credit limit is exceeded', but it still doesn't trigger that workflow for me.

    I am at a loss as to what I am getting wrong or where.

    I would like to take up your offer for you to send me a step by step guide on how to achieve my aim with these workflows, and at the same time try learn more about combining various workflows, as that seems difficult for sure.

    Once again, thank you so much for all your help.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    Alright,
    i'll will show u a few screenshots with the settings and a short description.

    That's the whole Workflow:
    zx76lfok6ufx.png


    You can create a workflow, like you can see in the picture. I showed the "Indent" Column, please check if they are correct.

    That are the response, for every Line:
    Line1 Response:
    oqaxxg1tpp4n.png

    Line 2 Response:
    or6gg396nvbn.png

    Line 3 Response:
    iboc6pdv5m3v.png

    Line 4 Response:
    chg6zfkbaypt.png

    Line 5 Response:
    7k5p0m134gbi.png

    Line 6 Response:
    6t6bqpnxuctf.png

    Line 7 Reponse:
    0vmet2zs75rc.png

    Line 8 Response:
    z2nqn2le9bd2.png

    If you rebuild it like that, it does the following:
    Whenever a approval of an Order with the Status open is requested, it starts an Approval process.
    When no more approvals are found, it checks for the Customer Credit Limit and starts another Approval Process.

    You maybe need to modify the condition for your requirements. (add your Custom Field)

    Important: You need to set the Table Relation, in the "Workflow - Table Relations" Table. As already posted in a previous answer.
    vpkkvsl6chgk.png

    If you can't select a response, you just have to check the missing option in the "Workflow Event/Response Combinations". (It can be found under Workflow -> Administration - or if you type "Workflow Event/Response Combinations" in the top right search bar)


  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Thank you so much for all your assistance. It seems to be working now except when I add filters to the 'A customer credit limit is exceeded' That seems to cause the workflow to stop working as expected.

    I will discuss with my client to see if we need these filters or if they want to add a group for them to use.

    Either way, we seem to be almost there. Once again, thanks for all your assistance.

    Regards,
    Malcolm
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Seems something may still be off and I am unsure again. Before I modified the workflow we had the original GP approval workflow set to a group of 4 users to approve. They are all set as level 1 so any of the 4 could pick up the approval and approve, it would then release the document. Now with the changes, it seems to be forcing all 4 users to approve before it will release the document.

    I am not sure where that change is and how to sort that out. I do believe it may have something to do with the 'On Condition' of my approval, but I don't think I changed anything there for the second line, but I may have in all my testing.

    Any idea on this?

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    edited 2020-09-29
    That should be the lines
    An approval request is approved -> Pending Approvals: 0 and
    An approval request is approved -> Pending Approvals: >0

    If you have a team with 4 user, with level 1 you need to set it to Pending Approvals: 3.
    So the line
    An approval request is approved -> Pending Approvals: 0 changes to
    An approval request is approved -> Pending Approvals: 3
    and the line
    An approval request is approved -> Pending Approvals: >0 changes to
    An approval request is approved -> Pending Approvals: >3

    That should work, because if you have all with the same level, 4 approval requests are generated. As soon as one request is approved, you have 3 left.

    Edit: I checked your attachment from a previous post, you didn't even have a Condition in the "An aproval request is approved." line. If you always just need one person to approve the request, you can remove the Condition.

    So you just need one line, without an Condition.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Any of the 4 users can approve, and if any of those 4 do, then it should continue. We do not need all 4 users to approve, just 1 of the 4.

    I will go back to my original screen shot to see what changed and make that change again, as my customer is now struggling with this as they are locking tables, complaining about all 4 needing to approve and so on.

    Let me try sort it out again.

    Thanks for all the assistance.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    Okay,
    then you don't need to check the Pending Approvals.
    If we take the screenshot from above.
    zx76lfok6ufx.png

    You can remove the line 5. And remove the Condition of line 2.

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    The attached screenshot shows the changes to line 2, I removed line 5 and my line 4 has no condition.

    Regards,
    Malcolmt4l1xipf5k1w.png
  • AluanAluan Member Posts: 158
    Looks good,
    that's working as long as you need only one person to approve.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    We seem to be getting closer, but something is still not right. I have setup my workflow as per your example, and all seems OK on the surface. I send the approval for the order and it goes to the group of 4 users. Any of those 4 can pick up the approval as it failed the GP %. One of the 4 users then approves, and it sends to the next group for the credit limit issues as the customer has exceeded his limit. All seems good, but it also released the document rather than sending it back to 'Pending Approval'.

    I tried to remove the 'release document' response in line 2;
    565byy0ei9oi.png
    but that didn't allow the workflow to move forward, so added it back.

    Thanks

    Malcolm
  • AluanAluan Member Posts: 158
    The third line is the line which should have "Set document status to Pending Approval".

    To the second line you should add "Approve the approval request for the record."

    2nd line:
    2jwzh5xqtizl.png

    If that doesn't work for you, please take a screenshot, or even better use the export function and upload it somewhere.

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    The changes didnt make a difference. I have exported my workflow and pasted it here for you: https://pastebin.com/UbBNhUKG

    Hope you can extract that.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    That's working for me. I only changed the team.
    Just for clarification, the approval request for the customer credit limit is created but the document status is changed to released? (You may want to check the Approval Entries)
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Yes, correct, the approvals are created as expected, but the document is released before it should be.

    Sales Order status:
    izuu3788r2jq.png

    Approvals as follows:
    GP Approval group can be either Babalwa or Victor in my test:
    Customer Credit Limit group can be either Tharina, Brenda or Malcolm

    Aproval entries:
    21o79itcepej.png

    You can see that the GP approval was done by Victor, which automatically set the status to approved for Babalwa as well, and then Victor sent the credit limit approval automatically to Tharina, Brenda and Malcolm. They are sitting as open, but the Sales Order is released.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    That's odd,
    do you have an additional Workflow running, or do you have some modification, so that you can't change the status to "Approval pending" when it's once released?

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    These are the workflows we have running for sales:
    gv0iviww0jkm.png


    There are no modifications around workflows that we have done to stop a status change. We did setup all the Sales Order Credit Limit approvals way back and then setup the one you have been assisting me with, and that is when we realised that the SO Credit Limit workflows were being ignored.

    I disabled the SO Credit limit workflows and still get the same result. I also removed the filters for the line 'A customers credit limit is exceeded' and that didn't change.

    Another error is that if the order is within its GP limit, so it should automatically approve but the credit limit has been exceeded, then when you send for approval I get an error 'No approval workflow for this record type is enabled'.

    I just cannot understand why it is so difficult to get different types of approvals to trigger for a sales document.

    Regards,
    Malcolm
  • MBClarkeMBClarke Member Posts: 71
    I had to re-enable the SO Credit Limit approval workflow to trigger than one when my existing SO GP is above the threshold
  • AluanAluan Member Posts: 158
    I would check the "Workflow Step Instance", there you can see what is getting triggerd with timestamps.
    I have only enabled the one worklfow, and it's working so far. So it's unfortunately hard to find the problem that you are facing.

    The message "No approval workflow for this record type is enabled", should only appear if no Workflow is found with matching conditions.
Sign In or Register to comment.