FlexiRule Docs
Manager Approval for Large Purchase Orders
How to implement an approval workflow based on document value.
Tutorial: Manager Approval for Large Purchase Orders#
This tutorial demonstrates how to block the submission of a Purchase Order if it exceeds a certain amount and hasn’t been approved by a manager.
Business Scenario#
Objective: Prevent unauthorized large expenditures. Criteria: Purchase Orders over $10,000 must have the “Manager Approved” checkbox checked before they can be submitted.
Step-by-Step Instructions#
1. Create the Rule#
- Rule Name: “PO Approval Enforcement”.
- Document Type: “Purchase Order”.
- Trigger Event: “Before Submit”.
2. Add the Value Check#
- Add a Condition node.
- Rule:
grand_totalis greater than10000.
3. Add the Approval Check#
- From the True branch (meaning it IS a large order), add another Condition node.
- Rule:
manager_approvedisNo(or 0).
4. Block Submission#
- From the True branch of the approval check (meaning it is large AND not approved), add a Stop and Error Handling (Stop) node.
- Mode: “Error”.
- Error Message: “Purchase Orders over $10,000 require Manager Approval before submission.”
5. Expected Result#
- If a PO is $5,000, it submits normally (Condition 1 is False).
- If a PO is $15,000 and “Manager Approved” is checked, it submits normally (Condition 2 is False).
- If a PO is $15,000 and “Manager Approved” is NOT checked, the user sees an error message and the submission is blocked.
Common Mistakes#
- Wrong Event: Using “On Submit” instead of “Before Submit”. “On Submit” happens after the document is already finalized, so you can’t block it with a simple error.
Was this page helpful?