---
title: "Codeunit 5790 Available to Promise"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5790-available-to-promise/
type: codeunit
id: 5790
name: "Available to Promise"
app: "Base Application"
namespace: Microsoft.Inventory.Availability
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5790-available-to-promise/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 5790 Available to Promise

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5790-available-to-promise/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Inventory.Availability |
| Versions | 17-28 |
| Source file | Inventory/Availability/AvailabletoPromise.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| QtyAvailabletoPromise | (var Record Item, var Decimal, var Decimal, Date, Option, DateFormula) | Decimal | public | 17-22 | Pending 20.0 | Replaced by CalcQtyAvailableToPromise() |
| CalcAvailableInventory | (var Record Item) | Decimal | public | 17-28 | - | - |
| CalcGrossRequirement | (var Record Item) | Decimal | public | 17-28 | - | - |
| CalcReservedRequirement | (var Record Item) | Decimal | public | 17-28 | - | - |
| CalcScheduledReceipt | (var Record Item) | Decimal | public | 17-28 | - | - |
| CalcReservedReceipt | (var Record Item) | Decimal | public | 17-28 | - | - |
| EarliestAvailabilityDate | (var Record Item, Decimal, Date, Decimal, Date, var Decimal, Option, DateFormula) | Date | public | 17-22 | Pending 20.0 | Replaced by CalcEarliestAvailabilityDate() |
| CalculateLookahead | (var Record Item, Option, Date, Date) | Decimal | public | 17-22 | Pending 20.0 | Replaced by CalculateForward |
| CalculateAvailability | (var Record Item, var Record Availability at Date) | - | public | 17-28 | - | - |
| UpdateScheduledReceipt | (var Record Availability at Date, Date, Decimal) | - | public | 17-28 | - | - |
| UpdateGrossRequirement | (var Record Availability at Date, Date, Decimal) | - | public | 17-28 | - | - |
| GetLookAheadPeriodEndDate | (DateFormula, Option, Date) | Date | public | 17-22 | Pending 20.0 | Replaced by GetForwardPeriodEndDate() |
| AdjustedEndingDate | (Date, Option) | Date | public | 17-22 | Pending 20.0 | Replaced by GetPeriodEndingDate() |
| SetPromisingReqShipDate | (Record Order Promising Line) | - | public | 17-28 | - | - |
| SetOriginalShipmentDate | (Record Order Promising Line) | - | public | 17-28 | - | - |
| SetChangedSalesLine | (Record Sales Line) | - | public | 17-28 | - | - |
| SetChangedAsmLine | (Record Assembly Line) | - | public | 17-28 | - | - |
| ResetItemNo | () | - | public | 17-28 | - | - |
| GetRequiredShipmentDate | () | Date | public | 19-28 | - | - |
| CalcQtyAvailableToPromise | (var Record Item, var Decimal, var Decimal, Date, Enum Analysis Period Type, DateFormula) | Decimal | public | 20-28 | - | - |
| CalcEarliestAvailabilityDate | (var Record Item, Decimal, Date, Decimal, Date, var Decimal, Enum Analysis Period Type, DateFormula) | Date | public | 20-28 | - | - |
| CalculateForward | (var Record Item, Enum Analysis Period Type, Date, Date) | Decimal | public | 20-28 | - | - |
| GetForwardPeriodEndDate | (DateFormula, Enum Analysis Period Type, Date) | Date | public | 20-28 | - | - |
| GetPeriodEndingDate | (Date, Enum Analysis Period Type) | Date | public | 20-28 | - | - |
| SetRecalculateFields | () | - | public | 24-28 | - | - |
| RunOnBeforeUpdatePurchOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | - | internal | 25-27 | - | - |
| RunOnBeforeUpdateSchedRcptAvail | (var Record Availability at Date, var Record Item, var Boolean) | - | internal | 25-27 | - | - |
| RunOnBeforeUpdateSchedNeedAvail | (var Record Availability at Date, var Record Item, var Boolean) | - | internal | 25-27 | - | - |
| RunOnBeforeUpdateServOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | - | internal | 25-27 | - | - |
| RunOnBeforeUpdateJobOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | - | internal | 25-27 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCalculateAvailability | (var Record Availability at Date, var Record Item) | 17-28 | - | - |
| Integration event | OnAfterCalcGrossRequirement | (var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterCalcScheduledReceipt | (var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterCalcReservedRequirement | (var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterCalcReservedReceipt | (var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterQtyAvailableToPromise | (var Record Item, Decimal, Decimal, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterCalcAvailableInventory | (var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnBeforeCalcAvailableInventory | (var Record Item, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcGrossRequirement | (var Record Item, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcScheduledReceipt | (var Record Item, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcReservedRequirement | (var Record Item, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcReservedReceipt | (var Record Item, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeQtyAvailableToPromise | (var Record Item, Date, var Decimal, var Decimal, Option, DateFormula, var Decimal, var Boolean) | 17-18 | - | - |
| Integration event | OnCalculateAvailabilityAfterClearAvailabilityAtDate | (var Record Availability at Date, var Record Item, var Date) | 18-28 | - | - |
| Integration event | OnEarliestAvailabilityDateOnBeforeFilterDate | (var Record Item, Decimal, Date, var Decimal, Option, DateFormula, var Record Availability at Date, var Date, var Boolean) | 18-22 | Pending 20.0 | Replaced by OnCalcEarliestAvailabilityDateOnBeforeFilterDate event |
| Integration event | OnBeforeUpdateSalesOrderAvail | (var Record Availability at Date, var Record Item, Record Sales Line, Record Order Promising Line, Date, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeQtyAvailableToPromise | (var Record Item, var Date, var Decimal, var Decimal, Option, DateFormula, var Decimal, var Boolean) | 19-22 | Pending 20.0 | Replaced by OnBeforeCalcQtyAvailableToPromise event |
| Integration event | OnCalcAllItemFieldsOnAfterItemCalcFields | (var Record Item) | 19-28 | - | - |
| Integration event | OnCalcAllItemFieldsOnBeforeItemCalcFields | (var Record Item) | 19-28 | - | - |
| Integration event | OnBeforeCalcQtyAvailableToPromise | (var Record Item, var Date, var Decimal, var Decimal, Enum Analysis Period Type, DateFormula, var Decimal, var Boolean) | 20-28 | - | - |
| Integration event | OnBeforeUpdatePurchOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | 20-27 | Pending 25.0 | Moved to codeunit JobPlanningAvailabilityMgt |
| Integration event | OnCalcEarliestAvailabilityDateOnBeforeFilterDate | (var Record Item, Decimal, Date, var Decimal, Enum Analysis Period Type, DateFormula, var Record Availability at Date, var Date, var Boolean) | 20-25 | - | - |
| Integration event | OnBeforeCalcAllItemFields | (var Record Item, var Boolean, var Code[20], var Text, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateSchedRcptAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-27 | Pending 25.0 | Moved to codeunit ProdOrderAvailabilityMgt |
| Integration event | OnBeforeUpdatePurchReqRcptAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateTransOrderRcptAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateSchedNeedAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-27 | Pending 25.0 | Moved to codeunit ProdOrderAvailabilityMgt |
| Integration event | OnBeforeUpdatePlanningIssuesAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateServOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-27 | Pending 25.0 | Moved to codeunit ServAvailabilityMgt |
| Integration event | OnBeforeUpdateJobOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-27 | Pending 25.0 | Moved to codeunit JobPlanningAvailabilityMgt |
| Integration event | OnBeforeUpdateTransOrderShptAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateAsmOrderAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeUpdateAsmCompAvail | (var Record Availability at Date, var Record Item, var Boolean) | 21-25 | - | - |
| Integration event | OnCalcEarliestAvailabilityDateOnAfterUpdateScheduledReceipt | (var Record Availability at Date) | 25-28 | - | - |
| Integration event | OnCalcEarliestAvailabilityDateOnBeforeFilterDate | (var Record Item, Decimal, Date, var Decimal, Enum Analysis Period Type, DateFormula, var Record Availability at Date, var Date, var Boolean, Date) | 26-28 | - | - |
| Integration event | OnBeforeUpdateAsmCompAvail | (var Record Availability at Date, var Record Item, var Boolean, var Record Assembly Line) | 26-28 | - | - |
| Integration event | OnUpdateAvailabilityOnBeforeInsertModify | (var Record Availability at Date, Date, var Decimal, var Decimal) | 26-28 | - | - |
| Integration event | OnCalculateAvailabilityByPeriodOnBeforeDeleteAvailabilityAtDate | (var Record Availability at Date, Record Availability at Date) | 26-28 | - | - |
| Integration event | OnCalcEarliestAvailabilityDateOnBeforeNextTempAvailabilityAtDate | (var Record Availability at Date) | 26-28 | - | - |
| Integration event | OnCalcEarliestAvailabilityDateOnAfterCalculateAvailableQty | (var Decimal, var Record Item, Decimal, Decimal) | 26-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
