Flag in BC for ordering above Max stock level
A Business Central AL extension that warns buyers in real time when a Purchase Order line would cause inventory to exceed the item’s Maximum Inventory threshold.
Business CentralALPurchasingGuardrails
Summary
Problem
Purchase Orders could unintentionally push inventory above an item’s Maximum Inventory level, creating overstock and tying up cash.
Solution
Built and published an AL extension that evaluates PO lines during entry and displays a warning when the order would exceed the Maximum Inventory threshold.
Result
A real-time guardrail that improves purchasing discipline while still allowing users to proceed intentionally when needed.
Business Impact
Prevents accidental over-ordering
Adds a clear “pause and confirm” moment before exceeding max inventory policy.
Low risk & reversible
No base table changes or posting logic changes; extension can be disabled/removed anytime.
Improves inventory discipline
Supports healthier max levels and reduces slow-mover build-up caused by oversized POs.
Gallery
Screenshots and artifacts from the build (sanitized where needed).
1) Build the extension in Sandbox
In Business Central SaaS, custom warning popups require an AL extension. Im VS Code, I used the AL Language extension, created a new sandbox project, and validated behavior end-to-end during PO entry.
2) Real-time evaluation
- Reads current on-hand inventory.
- Considers outstanding purchase quantities.
- Compares the resulting quantity against the item’s Maximum Inventory value.
- Shows a warning like: “Ordering this quantity will exceed the maximum inventory level (Max: X, Resulting Qty: Y).”
3) Deployment
After sandbox validation, the extension was approved and deployed to Production. It can be rolled back safely via Extension Management.