Workflows

2

Answers

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    I checked the step instances, but can only do that for the first approval of the GP. When that is approved and the approval entries are created for the credit limit group the step instances are gone as the system feels the workflow is complete because the order is released.

    I created a screen shot of the first leg entries and then of the archived step instance, not sure if that offers any answers. I am at a loss now as to why this is not working as intended if yours does. I might now need a developer to step through the process manually to see where it fails or why.

    Thank you so much for all your assistance so far, it is greatly appreciated.
    g1kxzixatuj9.png

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    edited 2020-10-01
    Yeah,
    maybe you should check that with a developer. I imported your pastebin (https://pastebin.com/UbBNhUKG) into Business Central, and it's working there as well.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    I think I finally figured out where the issue is. I re-created my workflow as per our examples above, only difference in my Cronus is that I do not have the GP% modification, but created the workflow per screenshots from you.

    I added a group for the order approval, for line 1 and a group for the credit limit portion. As soon as I approve the order, it creates the approval entries for the second group but releases the document as per all my testing before. As soon as I remove the second approval group, only have the credit limit portion go to a specific approver does it seem to work and the document remains 'Pending Approval' and the approval entries are created for the credit limit.

    So it would seem that somewhere in my entire process it doesn't like an approval group for the credit limit portion.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    edited 2020-10-01
    Your group does have more than one user, right?
    Because, if i create a group with one user and the approver is the same as the user in the group it get's automatically approved. But that's visible in the Approval Entry. (The Status changes to Approved)
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    I am logged in as user 3. My first group consists of user 1 & 2, my second group consists of user 4 & 5. I send the approval, it shows that user 3 sent it to user 1 & 2. My condition for this approval is <Always> as either user 1 or 2 can approve.

    I then log in as user 1 and approve, a message comes up that an approval was sent. When I check the approval entries, user 1 and 2 are set as approved, and it is open for user 4 & 5, but document is released.

    Condition for the credit limit 'An approval request is approved' is also set to <always> as either user 4 or 5 can approve the credit limit. This releases the document before they approve.

    If I change group 2 to a specific approver instead, say user 5, then the document remains as 'Pending' until I log in as user 5 and approve. If I add the group back and change the condition to 'Pending Approval: >1 or 0 or anything else, the document is released before user 4 or 5 approve.

    It seems it is either due to the group or the condition.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    If you use the first group twice, does happen the same?

    In my opinion it must be something with the group. I think you have to check the "Workflow Step Instance" again, or the "Workflow Step Instance Archive". There you should see if the "Set document status to Pending Approval" is executed, and what happens afterwards.

  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    If I use the same group it still released the document. So it definitely is either the condition or group.

    I think we will tell the client they cannot have a group for the credit limit portion and go from there.

    I really want to thank you for all your assistance in this issue and doing all you have to assist me in finding a solution.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    No problem,
    still wondering why it isn't working. :sweat_smile:
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    One quick question. I changed the workflow a little. I still have my group for the Sales Order approval, but now have 1 user in the group as level 1, and the other 3 users are all level 2. So all order approval will go to user 1 first, if they approve, then anyone of the other 3 can pick up the order and approve.

    When I do this, it works in the fact that user 1 get the approval, approves, and it creates the other 3 approval for the other 3 users. If 1 of those users approves, the document is released, but the approval entry still sits as 'open' for the 2 users that did not pick up the approval.

    So the document is released, which is fine, but the 2 users out of the 3 that didn't do the approval have these approvals on their name. I set the lines: An approval request is approved: Pending Approval:2 and An approval request is approved: >2

    If I change that to any other values the workflow doesn't work, so not sure why it wont set the approval entry to 'approved' for all the users.

    saold06ycmfq.png

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    You are probably missing "Approve the approval request for the record." in the second line.
    If you add that to the Response all Approval Requests should be approved.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    If I do that, then the approval entries are all approved when the first person approves, and it bypasses the other 3 users in the group.

    It isn't a huge issue at this time, just trying to get it working for my client without them complaining that they have approvals in their list.

    Regards,
    Malcolm
  • AluanAluan Member Posts: 158
    edited 2020-10-06
    Well,
    if one of the 3 user approves there should be 2 approval requests left, so it should work.
    You can check the Approval Entry Table (454), there you have a Column "Pending Approvals", that's the value you need.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    As mentioned, we changed the SO approval a little. I have it setup as a group to approve. In that group are 4 users, where 1 user is level 1, and 3 are level 2. To me this means that the level 1 user gets the approval and approves, then any of the 3 level 2 users can approve. When 1 of them does, it is still forcing us to have all 3 approve.

    These are the approval entries:
    0uftf5my920b.png


    You can see that Tharina was level 1 approver, and Babalwa is level 2, as is Elmein and Moira. Babalwa has approved, so it should be OK and document should be released, but it is still 'Pending' until the other 2 approve.

    My workflow:
    d8hyfq659n2k.png

    Response to line 2:
    45d0r2gtpxww.png

    Response to line 3:
    8uuqn97t7vbk.png


    I have again tried multiple combinations with the number behind 'An approval request is approved' and cannot again find the correct combination.

    Thanks once again for all your assistance. One day I will understand these workflows.

    Regards,
    Malcolm
  • MBClarkeMBClarke Member Posts: 71
    If I check table 454, the field 'Pending Approval' are all set to 1 for these users.

    ugd2b7qtra8l.png


    Should that be different?
  • AluanAluan Member Posts: 158
    edited 2020-10-06
    Can you tell me what version you are exactly using? (I guess 2018 CU 21?)
    So if i get time i can maybe set up a new system with the same Version.

    The "Pending Approvals" should be 2 in that case. Because you have 2 Open Approval Entries.
    And that should trigger the second line.
  • MBClarkeMBClarke Member Posts: 71
    HI Aluan,

    I am testing in Microsoft Dynamics 365 Business Central, Version W1 14.4, but the client I want to implement this for is on version NAV 2018, version W1 11.0

    With my setup as it is, I get the first approval, the other 3 sit in the approval entry screen as 'created', then the first approver in the group approves, and the approval entry 'created' changes to open for the 3 users. One of those 3 approves, then the approval entry changes to 'approved' for that user and stays as 'open' for the other 3 and the document isn't released. This is where I am stuck.

    Regards,
    Malcolm
  • MBClarkeMBClarke Member Posts: 71
    These are the steps for my process;

    Workflow as follows:
    fmh1efi2q5tf.png

    Workflow group:
    eoyvnldsmiyr.png


    Sales Order created, sent for approval. Approval Entries:
    5cq9lcz9dsor.png

    Table 454 entries:
    2fud5cknxjx4.png


    User "ADMIN' approves the document, approval entries:
    79rzpuf643p3.png

    Table 454 entries:
    r2atu8coibnt.png

    User 'ADMIN2' approves the document. Approval Entries:
    yaqfrrawq2uq.png

    Table 454 entries:
    e53ss3a7oofk.png


    Sales Order status:
    waa2i9ja86d5.png


    Based on all the info, it would seems that either the group is working correctly, or something to do with the steps or how many approvals are created.
  • AluanAluan Member Posts: 158
    edited 2020-10-06
    I really don't know what's happening, because that should trigger the 2nd line (Pending Approvals: 2).

    Can you try it with the default Workflow Template (Sales Order Approval Workflow)?
    Because that's what i did and it's working...
    I just added a team and modified the line 2 and 3. Like in your screenshots.

    Edit: I guess i found the issue. In the "Response to line 3" you need to click on "<(Optional Select Next Step>" and there you have to select "Send approval request for the record and create a notification." from the first line.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    My test has been with a standard Workflow template in Cronus, that is why I am confused as well.

    On another note, do you know if it is possible to create an approval for a customer that has an overdue balance? Right now one just gets the soft warning about it, but no approval is required.

    Thanks

    Malcolm
  • AluanAluan Member Posts: 158
    Yeah,
    that should be the field "Balance Due" in the Customer Card. Maybe you need to set a Table Relation, depends on where do you want to start the approval process.

    To the problem before, at least in your screenshot of Line 3 the "<(Optional) Select Next Step>" is not set. That should be the problem.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Sorry, I am unclear on your response to my pervious issue about Line 3. Could you please elaborate?

    Thanks,
    Malcolm
  • AluanAluan Member Posts: 158
    Did you see the edit from the previous answer?
    Edit: I guess i found the issue. In the "Response to line 3" you need to click on "<(Optional Select Next Step>" and there you have to select "Send approval request for the record and create a notification." from the first line.

    That's the screenshot i am talking about:
    8uuqn97t7vbk.png

  • MBClarkeMBClarke Member Posts: 71
    But isn't the response for line 3 already set to that?

    rx9h8bae4zar.png

    Now I am even more confused....sorry
  • AluanAluan Member Posts: 158
    No,
    you need click on <(Optional) Select Next Step> and select the other line, as described above.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    Still lost. Is this what you mean? This is my line 3 setup:
    6zhxtunrwand.png

    The response is 'Send approval request for the record and create a notification, and the 'Optional next step is the same.

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

    Going back to the original approval process you have assisted me with, they now want the approval to go for the GP% approval, then check if the customer has an overdue account, and then check if they are over their credit limit.

    Is this possible? If so, where do we add the overdue account option?

    They are now getting very involved with these approvals and what is required.

    Regards,
    Malcolm
  • MBClarkeMBClarke Member Posts: 71
    Sorry, let me rephrase this. They want to sales order to first check if the customer has an overdue amount, that needs to be approved by a group if possible, or 1 user, then check the GP% and then the credit limit.
  • MBClarkeMBClarke Member Posts: 71
    No requirements have changed again.

    1st check for overdue account, go to a group,
    2nd check for credit limit issue, go to same group as above
    3rd check the GP% issue, go to a different group if possible
  • AluanAluan Member Posts: 158
    edited 2020-10-07
    MBClarke wrote: »
    Hi Aluan,

    Still lost. Is this what you mean? This is my line 3 setup:
    6zhxtunrwand.png

    Yes, that's exactly what i mean. Now it should work.

    The other requirement, yes you should be able to put everything in one Workflow. You can use the existing Workflow and modify it. Before you start, the requirements should be clear, so you don't have to modify it serveral times.
  • MBClarkeMBClarke Member Posts: 71
    Hi Aluan,

    OK, adding that Optional step seemed to do the trick....thanks again for the help.

    As for the additional requirement to the first workflow we worked on, it is as follows, When the SO is sent for approval it needs to check for an overdue account, then check for credit limit issues....either or both fails should go to the same group for approval....if approved, then go for GP% approval to a different group.

    With that done, how would I structure this one using the original workflow that started with GP% approval then credit limit, now the order must change around.

    I think after all this you will be done with me. I do truly appreciate all your assistance on this.

    Regards,
    Malcolm
Sign In or Register to comment.