Use date-aware availability for promising
Item.Inventory is an on-hand quantity, not an available-to-promise answer. Promising additional demand must account for the requested date, location and variant, reservations, scheduled receipts, existing requirements, and demand within the configured lookahead.
- microsoftlayer
- scmdomain
- 2examples
- 2pull requests
Rule on GitHub · microsoft layer · scm · BC all · tier official · derived
Description
Item.Inventory is an on-hand quantity, not an available-to-promise answer. Promising additional demand must account for the requested date, location and variant, reservations, scheduled receipts, existing requirements, and demand within the configured lookahead. An on-hand comparison can promise inventory already committed elsewhere and miss incoming supply.
Best Practice
For additional demand not already recorded on a source line, "Available to Promise".CalcQtyAvailableToPromise uses the Item’s location/variant filters, date range ending on the shipment date, and configured period/lookahead horizon. Its result and the additional quantity are compared in base units. A fresh calculation context or the codeunit’s recalculation support avoids carrying cached quantities between unrelated items or requests.
The source-aware order-promising/availability workflow accounts for an existing sales line’s own quantity or delta; applying an additional-demand calculation to that line can double-count it. Assembly and production requirements/supply likewise participate in the standard availability context, not just a sales-only stock subtraction.
An ATP result is not a reservation or a guarantee of warehouse pickability. Lot/serial constraints, bins, warehouse activity, and later concurrent changes still need their own checks. Conversely, an on-hand display, valuation report, or deliberately immediate-stock-only check can use Item.Inventory: it answers a different business question from ATP.
See sample: use-date-aware-availability-for-promising.good.al.
Anti Pattern
CalcFields(Inventory) or an equivalent item-ledger quantity sum used as the complete decision for a dated additional-demand promise ignores existing demand and incoming supply, even with location/variant filters. An Inventory FlowField read for an on-hand display has no such promising contract.
Losing location, variant, date, or source-line context changes the calculation’s business meaning. Another supported workflow that preserves the same availability semantics does not have to call this exact API.
See sample: use-date-aware-availability-for-promising.bad.al.
References
- Calculate order-promising dates
- Availability in the warehouse
- BaseApp ATP calculation
- Forward-demand lookahead
Examples
- Good: use-date-aware-availability-for-promising.good.al
- Bad: use-date-aware-availability-for-promising.bad.al
Changed by
- #192 Add SCM functional knowledge domain, 2026-09-21
- #57 Add source-verified Finance knowledge and review domain, 2026-09-21
From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).