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;
This triggers the workflow of Power Automate. This flow also prevents 'Open' Sales Orders to be Released without going through the approval flow first.
The design of the flow in Power Automate is currently as follows
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
as I get following error
{
"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;
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.