In this post we are going to discuss about approval process of a Purchase order from Business Process Flow. In many cases a business requires approval of a process from different members or teams depending on the type of approval or the reporting team.
In this Scenario we are considering a Purchase Order approval depending on the Order value in Dollars.
Create and Set the Approving Team
Let us consider Sales Team Members can approve purchase orders below 500$ and Sales Team Leaders can approve purchase orders up to 2000$ and above that it need to be approved by Sales Manager.
Create the above Teams add the members required to the respective teams.
On the purchase order form, we need to create a field “Approval Team.”
This field should be auto populated depending on the value of the Purchase Order. We need to create a business rule to set the field value as below.
IF
Total Amount less than or equal 500
THEN
Set Approving Team to “Sales Team Member”
ELSE IF
Total Amount less than or equal 2000
THEN
Set Approving Team to “Sales Team Lead”
ELSE
Set Approving Team to “Sales Manager”

To check if the user is a member of the team we use a simple process, but we need some custom workflow activities. We must import the Dynamics 365 Workflow tools Solution in the environment we are trying to create the approval process. The solution can be downloaded from GitHub link below.
Releases · demianrasko/Dynamics-365-Workflow-Tools · GitHub
Once the Approving team is set and Workflow tools solution is imported, we can create an on demand workflow to validate the Purchase Order Approval.
Create a new real time workflow on the Purchase Order Table and set it as on demand.
Add step Is user in Team




Once the Business Rule and Workflow are set, we need to add them to the Approval stage in the Business Process Flow.
Open the BPF and click on the Approval Stage in the editor on the right pane you can view the option to add a Business Rule to this stage option from where we can add the business rule.

Once all this is done the Approval process should work as expected. Only the members of the teams specified in the approving team will be able to approve the purchase order and move to the next stage. If the Approving user is not part of the team, it throws an error as below.
