Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nlaUEL6d3wXEMjmbnCmke3
Power Automate - General Discussion
Answered

3 approval flows on 1 Business Central Sales Order in Power automate

Like (0) ShareShare
ReportReport
Posted on 9 Mar 2023 10:39:41 by 27

Dear Community members,

 

Currently I am working on an approval flow containing three approval flows in 1:

 

Check 1: Balance of the customer does not exceed the Credit Limit

Check 2: Balance due of the customer is equal to 0

Check 3: Profit margin is equal or exceeds the profit margin on the customer card (Custom field)

 

Trigger is the 'Send Approval Request' button on the 'Open' (status) Sales Order;

 

Maassimaassimo_0-1678356901161.png

 

This triggers the workflow of Power Automate. This flow also prevents 'Open' Sales Orders to be Released without going through the approval flow first.

 

Maassimaassimo_1-1678356958733.png

 

The design of the flow in Power Automate is currently as follows

Maassimaassimo_2-1678357002348.png

 

The Workflow once triggered can be completed in Power Automate(!) and if approval is needed the person will get a notification in Teams, Outlook and Power Automate app + if approval is given the flow will be completed in the flow page of Power Automate (not in Business Central).

 

However, the status of the Sales Order never changes from 'Pending Approval' to 'Released' even if every check passed the condition. This requirement is critical and the reason why we chose Power Automate as the workflows in Business Central were coming up short for multiple checks on Sales Orders with the same criteria.

 

My question is; How can I make sure that after approval or exit of the approval flow due to the fact it passed the condition the Sales Order status will be changed from 'Pending Approval' to 'Released'.

 

I already tried the following approach if approval is not needed, but this does not work

 

Maassimaassimo_3-1678357397424.png

as I get following error

 

Maassimaassimo_4-1678357788264.png

{
"status": 400,
"message": "ErrorCode: Application_DialogException The workflow step instance id {00000000-0000-0000-0000-000000000000} was not found. CorrelationId: *ID-number*d52d6.\r\nclientRequestId: *ID-number*43001",
"error": {
"message": "ErrorCode: Application_DialogException The workflow step instance id {00000000-0000-0000-0000-000000000000} was not found. CorrelationId: *ID-number*d52d6."
},
"source": "api.businesscentral.dynamics.com",
"errors": []
}

 

Same problem if approval is needed;

 

Maassimaassimo_5-1678357868255.png

 

In conclusion I would like to know how I can change the status of my sales order using the Workflow responses.

 

Thank you very much in advance.

  • Verified answer
    Maassimaassimo Profile Picture
    27 on 14 Mar 2023 at 08:58:54
    Re: 3 approval flows on 1 Business Central Sales Order in Power automate

    Changing the approval flow from 'Approve/Reject - First to respond' to 'Custom Responses - Wait for one response' did the trick.

  • Maassimaassimo Profile Picture
    27 on 09 Mar 2023 at 12:57:41
    Re: 3 approval flows on 1 Business Central Sales Order in Power automate

    UPDATE:

     

    By Adding following steps you can manage the responses and ensure that on approval flow response "Approve" - it releases the sales order document

     

    Maassimaassimo_0-1678366379601.png

     

    However, the problem remains, once the number of conditions which need approval is 2 or more

    (for example Credit Limit is exceeded AND Balance Due is > 0)

    1 positive (approve) approval response releases the Sales Order Document even if the other approval remains unanswered

    1 negative (decline) approval response reopens the Sales Order Document even if the other approval remains unanswered

    How can I ensure that the Sales Order Document remains in status "Pending Approval" as long as all conditions have not been met? - in other words

    Check 1 condition: was either approved or could be exited due to no check needed

    AND

    Check 2 condition: was either approved or could be exited due to no check needed

    AND

    Check 3 condition: was either approved or could be exited due to no check needed

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started