Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Setting up Worflow with 2-stage approval by groups where ANY member can approve

(0) ShareShare
ReportReport
Posted on by

Hi all,

I struggle to get workflow to process correctly following scenario. The workflows designed as 2-stage approval, trigerred by record change (Item card). First it needs to be reviewed by the group 1 members (technology and planing) and ANY group member can pass it to the 2nd stage  (finance group). The members of the second groups should be notified only after the group1 has passed it on to them.

I can get it working fine with 1-stage setup, when any member of Group1 can approve it and it (this has been good guidance https://community.dynamics.com/nav/b/dynamicsnavcloudfronts/archive/2017/11/06/approval-workflow-using-workflow-user-group-in-microsoft-dynamics-nav)

But if I set it following this logic for this 2-stage group approval, it is stumbling in the second stage... 

This is the setup I'm using. Group1 has 3 members, group2 has 2 members. This is set as ONE workflow group with 3 members on sequence 1 level and 2 members on Sequence2 level in this workflow group.
2stageGroupApprovalWorflow.png

Workflow is triggered fine.

Approval Entry table is updated with records of the Group1 members, they get notified.

If anyone approves it, *4th line of the workflow with the filter on sequence no.1, there are additonal approval entries created for the two memebrs of the group 2, they get notified.

Group1_5F00_response.png

But in the second stage, when one of them approves, the approval record does not get approved for the other member...basically they both have to approve for their approval entry to be cleared from the list of those to be handled, but the record itself does NOT get the new values applied.

Group2_5F00_response.png

What I'm not certain about are the filters set in the workflow... It seem to work with the first stage (filtering for the sequence 1, ie. group 1 there and the number of pending approvals lower then total number of members in the workflow group.

I'm not certain if I'm not missing anything with the indentation in the workflow, do not really see what it is for and whether different indentation levels somehow control what workflow step gets executed first..

*This post is locked for comments

  • Suggested answer
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hello,

    I am attaching my instructions to setup a Approval Group and the proper flows.

    Hope this helps.

    Thanks,

    Steve

    2860.3-Approval-Groups.docx

  • boot26 Profile Picture
    boot26 10 on at
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hi Mun Kit

    can I ask please, did you get an answer to this question anywhere? I am also struggling with this

  • Mun Kit Profile Picture
    Mun Kit 25 on at
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hi Jan,

    Can i ask how do you achieve the below ? which line and response actually make the below happen in stage 1 ?

    The 3 Approval entry records get ALL status changed to "Approved" when ANY of the 3 users approve their entry.

  • RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hi OlaQ,

    unfortunately I never got this working using standard NAV workflow approval functionality. In the end we modified it and instead of second level approval group, there is just notification sent out to those users after 1st stage group member approves.

    Discussed this with our partner and they would be able to customise this behaviour to suit our requirement, but since the "temporary" solution above has proved to be working well in the meantime, we just did not go for the customisation.

    Regards, Jan

  • OlaQ Profile Picture
    OlaQ 72 on at
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Dear Jan ,

    I am facing the Same thing , did u find any solution to this without customization

    thanks and regards

  • RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    This is the definition of step two..and the workflow overview

    2StageWorkflawCode.png

    2StageWorkflawCode.png

    NAV of course has this in the Workflow Step table but the execution is done by standard NAV workflow logic.. not sure is you were asking for some C/AL code... there is nothing custom, standard NAV 2016 Workflow that I'm trying to work as desired with these settings

  • Suggested answer
    CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    I suggest use the debugger to check why its not modifiying. Can you paste your code for sequence 2?

  • RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hi Chris,

    At the beginning of the workflow there are 5 approval entry records created

    3 fro the Sequence 1 users, all in Status "Open"

    2 for teh Sequence 2 users, both in Status "Created"

    The 3 sequence 1 users get notified, all see the approval in their Requests to Approve page.

    At this stage, Sequence/Stage2 users do NOT see the approval entry to handle it, they got no notification.

    First response for the sequence/stage 1 works fine

    The 3 Approval entry records get ALL status changed to "Approved" when ANY of the 3 users approve their entry.

    The 2 Approval Entry records fro the Sequence/Stage 2 users get their status changed to "Open"

    Sequence / Stage 2 users get notified of an approval to be handled.

    This is working as expected, no problem so far.

    The problem is in Stage 2.. if either of the users approve (typo in my earlier post I wrote "notifies" but meant "approve" srry), it is only their individual entry that gets approved. The other Approval Entry with Sequence 2 remains in Open status and the other user still see it as approval to be handled.

    The values do not get applied..

    I assume that that response simply does not get executed ever... not sure it is because of the filter, or the indentation (but I do not see indentation playing any role in the execution of the workflow logic by looking at how the data look like in the background). It seem as if the user only changes his/her approval record but there is no response triggered or executed.

    I see nothing wrong with the filter though, it is indeed the response that should run when Sequence 2 approves and there will clearly be <4 entries to approve (the Approval Entry has flowfield for this and it correctly shows 2 at this stage.)

    But it doesn't and I see no reason why not :(

  • Suggested answer
    CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: Setting up Worflow with 2-stage approval by groups where ANY member can approve

    Hi,

    I believe your sequece one is working fine, but there is an issue in your second sequence. 

    Can you clearify this statement 

    "But in the second stage, even if one of them notifies, the approval record does not get approved for the other member...basically they both have to approve for their approval entry to be cleared from the list of those to be handled, but the record itself does NOT get the new values applied."

    If in the sequnce two, you have two users in your Workflow user group and you want both the users should approve only then the Item should be approved then set Pending approval:0  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans