---
title: "Codeunit 5895 Inventory Adjustment"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/
type: codeunit
id: 5895
name: "Inventory Adjustment"
app: "Base Application"
namespace: Microsoft.Inventory.Costing
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/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 5895 Inventory Adjustment

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/

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

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| SetProperties | (Boolean, Boolean) | - | public | 17-28 | - | - |
| SetFilterItem | (var Record Item) | - | public | 17-28 | - | - |
| MakeMultiLevelAdjmt | () | - | public | 17-28 | - | - |
| SetJobUpdateProperties | (Boolean) | - | public | 17-28 | - | - |
| CallInitializeAdjmt | () | - | public | 18-28 | - | - |
| CallFinalizeAdjmt | () | - | public | 18-28 | - | - |
| CallInvtToAdjustExist | (var Record Item) | Boolean | public | 18-28 | - | - |
| CallMakeSingleLevelAdjmt | (var Record Item, var Record Avg. Cost Adjmt. Entry Point) | - | public | 18-28 | - | - |
| CallWIPToAdjustExist | (var Record Inventory Adjmt. Entry (Order)) | Boolean | public | 18-28 | - | - |
| CallMakeWIPAdjmt | (var Record Inventory Adjmt. Entry (Order), var Record Avg. Cost Adjmt. Entry Point) | - | public | 18-28 | - | - |
| CallAssemblyToAdjustExists | (var Record Inventory Adjmt. Entry (Order)) | Boolean | public | 18-28 | - | - |
| CallMakeAssemblyAdjmt | (var Record Inventory Adjmt. Entry (Order), var Record Avg. Cost Adjmt. Entry Point) | - | public | 18-28 | - | - |
| CallUpdateAdjmtBuf | (Record Value Entry, Decimal, Decimal, Date, Enum Cost Entry Type) | Boolean | public | 18-28 | - | - |
| CallPostAdjmtBuf | (var Record Avg. Cost Adjmt. Entry Point) | - | public | 18-28 | - | - |
| CallSetAppliedEntryToAdjustFromBuf | (Code[20]) | - | public | 18-28 | - | - |
| CallAppliedEntryToAdjustBufExists | (Code[20]) | Boolean | public | 18-28 | - | - |
| CallUpdateJobItemCost | () | - | public | 18-28 | - | - |
| IncludedInCostCalculation | (Record Value Entry, Integer) | Boolean | public | 20-28 | - | - |
| ExpCostIsCompletelyInvoiced | (Record Item Ledger Entry, Record Value Entry) | Boolean | public | 20-28 | - | - |
| CallPostOutputAdjmtBuf | (var Record Avg. Cost Adjmt. Entry Point) | - | public | 24-28 | - | - |
| MakeMultiLevelAdjmt | (var Codeunit Cost Adjustment Params Mgt.) | - | public | 26-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAdjustOutbndAvgEntryOnBeforeForwardAvgCostToInbndEntries | (var Record Item Ledger Entry) | 17-28 | - | - |
| Integration event | OnAfterGetValuationPeriod | (var Record Date, Record Item) | 17-28 | - | - |
| Integration event | OnAfterGetVisitedEntries | (var Record Value Entry, Record Value Entry, var Record Item Ledger Entry) | 17-28 | Pending 26.0 | Replaced by OnExcludeAvgCostOnValuationDateOnAfterGetItemApplicationTrace event |
| Integration event | OnAfterIsAvgCostItem | (var Record Item, var Boolean) | 17-28 | - | - |
| Integration event | OnAfterMakeMultiLevelAdjmt | (var Record Item, Boolean, Boolean, var Record Item) | 17-28 | - | - |
| Integration event | OnBeforeCopyILEToILE | (var Record Item, Record Item Ledger Entry) | 17-28 | - | - |
| Integration event | OnBeforeCopyItemToItem | (var Record Item, var Record Item, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeIsUpdateCompletelyInvoiced | (Record Item Ledger Entry, Boolean, var Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeMakeMultiLevelAdjmt | (var Record Item, Boolean, Boolean, var Boolean) | 17-20 | - | - |
| Integration event | OnBeforeOpenWindow | (var Boolean) | 17-22 | - | - |
| Integration event | OnBeforeUpdateWindow | (var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUpdateItemUnitCost | (var Record Avg. Cost Adjmt. Entry Point, var Boolean) | 17-19 | - | - |
| Integration event | OnBeforeUpdateConsumpAvgEntry | (Record Value Entry, var Boolean) | 17-28 | - | - |
| Integration event | OnCopyAvgCostAdjmtToAvgCostAdjmtOnAfterInsert | (var Record Avg. Cost Adjmt. Entry Point) | 17-28 | - | - |
| Integration event | OnCopyCostElementBufToValueEntryBufOnBeforeValueEntryBufInsert | (var Record Value Entry, Record Cost Element Buffer) | 17-28 | - | - |
| Integration event | OnCopyValueEntryBufToCostElementBufOnBeforeCostElementBufferInsert | (var Record Cost Element Buffer, Record Value Entry) | 17-28 | - | - |
| Integration event | OnForwardAppliedCostOnAfterSetAppliedQty | (Record Item Ledger Entry, var Decimal) | 17-28 | - | - |
| Integration event | OnGetOrigValueEntryOnAfterOrigValueEntryFound | (var Record Value Entry, Record Value Entry) | 17-28 | - | - |
| Integration event | OnPostItemJnlLineCopyFromValueEntry | (var Record Item Journal Line, Record Value Entry) | 17-28 | - | - |
| Integration event | OnPostItemJnlLineOnAfterSetPostingDate | (var Record Item Journal Line, Record Value Entry) | 17-19 | - | - |
| Integration event | OnMakeMultiLevelAdjmtOnAfterMakeAdjmt | (var Record Avg. Cost Adjmt. Entry Point, var Record Item, var Record Rounding Residual Buffer, Boolean, Boolean, var Codeunit Item Jnl.-Post Line) | 17-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnAfterUpdateItemUnitCost | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Boolean) | 17 | - | - |
| Integration event | OnBeforeUpdateJobItemCost | (var Record Job) | 17-28 | Pending 26.0 | Record parameter Job is replaced with list parameter JobsToAdjust |
| Integration event | OnUpdateItemUnitCostOnAfterItemGet | (var Record Item) | 17-28 | - | - |
| Integration event | OnUpdateItemUnitCostOnAfterModifyItemNotStandardCostingMethod | (var Record Item) | 17-28 | - | - |
| Integration event | OnUpdateItemUnitCostOnBeforeModifyItemNotStandardCostingMethod | (var Record Item) | 17-28 | - | - |
| Integration event | OnPostOutputOnBeforePostItemJnlLine | (var Record Item Journal Line, Record Value Entry, Record Inventory Adjustment Buffer) | 17-19 | - | - |
| Integration event | OnAfterInitAdjmtJnlLine | (var Record Item Journal Line, Record Value Entry, Enum Cost Entry Type, Enum Cost Variance Type, Decimal) | 17-28 | - | - |
| Integration event | OnWIPToAdjustExistOnAfterInventoryAdjmtEntryOrderSetFilters | (var Record Inventory Adjmt. Entry (Order)) | 17-28 | - | - |
| Integration event | OnAdjustItemAvgCostOnAfterLastTempAvgCostAdjmtEntryPoint | (var Record Avg. Cost Adjmt. Entry Point, var Boolean, var Boolean) | 18-28 | - | - |
| Integration event | OnAdjustItemAvgCostOnAfterCalcRestart | (var Record Value Entry, var Boolean) | 18-28 | - | - |
| Integration event | OnAvgValueEntriesToAdjustExistOnAfterSetAvgValueEntryFilters | (var Record Value Entry) | 18-28 | - | - |
| Integration event | OnAvgValueEntriesToAdjustExistOnAfterSetChildValueEntryFilters | (var Record Value Entry) | 18-28 | - | - |
| Integration event | OnExcludeAvgCostOnValuationDateOnAfterSetItemLedgEntryInChainFilters | (var Record Item Ledger Entry) | 18-28 | Pending 26.0 | Use OnExcludeAvgCostOnValuationDateOnAfterGetItemApplicationTrace instead. |
| Integration event | OnIsOutputWithSelfConsumptionOnAfterSetTempItemLedgEntryFilter | (var Record Item Ledger Entry) | 18-28 | Pending 26.0 | Replaced by OnIsOutputWithSelfConsumptionOnAfterGetItemApplicationTrace |
| Integration event | OnIsOutputWithSelfConsumptionOnAfterSetConsumpValueEntryFilters | (var Record Value Entry) | 18-28 | - | - |
| Integration event | OnOpenOutbndItemLedgEntriesExistOnAfterSetOpenItemLedgEntryFilters | (var Record Item Ledger Entry) | 18-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnAfterUpdateItemUnitCost | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Boolean, Boolean) | 18-20 | - | - |
| Integration event | OnUpdateConsumpAvgEntryOnAfterSetItemLedgEntryFilters | (var Record Item Ledger Entry) | 18-28 | - | - |
| Integration event | OnAfterCalcInbndEntryAdjustedCost | (var Record Cost Element Buffer, var Record Value Entry, Record Item Ledger Entry, Record Item Application Entry, Integer, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforePostItemJnlLine | (var Record Item Journal Line, Record Value Entry, Decimal, Decimal, Boolean, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeUpdateAdjmtBuf | (Record Value Entry, Decimal, Decimal, Date, Enum Cost Entry Type, var Boolean, var Boolean) | 19-22 | - | - |
| Integration event | OnAvgValueEntriesToAdjustExistOnFindNextRangeOnBeforeAvgValueEntriesToAdjustExist | (var Record Value Entry, var Record Value Entry, var Record Avg. Cost Adjmt. Entry Point) | 20-28 | - | - |
| Integration event | OnBeforeCalcInbndEntryAdjustedCost | (var Record Cost Element Buffer, Record Item Application Entry, Integer, Integer, Boolean, Boolean, var Boolean, var Boolean) | 20-28 | - | - |
| Integration event | OnBeforeUpdateItemUnitCost | (var Record Avg. Cost Adjmt. Entry Point, var Boolean, var Record Item, var Record Item Ledger Entry) | 20-28 | Pending 26.0 | Record parameter TempItemLedgerEntry is replaced with dictionary parameter ItemLedgEntryToAdjust |
| Integration event | OnPostItemJnlLineOnAfterItemJnlPostLineRunWithCheck | (var Record Item Journal Line, Record Value Entry) | 20-28 | - | - |
| Integration event | OnPostItemJnlLineOnAfterSetPostingDate | (var Record Item Journal Line, Record Value Entry, Date, var Record Item) | 20-28 | - | - |
| Integration event | OnInvtToAdjustExistOnBeforeCopyItemToItem | (var Record Item) | 20-28 | - | - |
| Integration event | OnPostOutputOnBeforePostItemJnlLine | (var Record Item Journal Line, Record Value Entry, var Record Inventory Adjustment Buffer, var Record General Ledger Setup, var Boolean) | 20-28 | - | - |
| Integration event | OnBeforeMakeMultiLevelAdjmt | (var Record Item, Boolean, var Boolean, var Boolean) | 21-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnAfterUpdateItemUnitCost | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Boolean, Boolean, var Codeunit Item Jnl.-Post Line) | 21-28 | - | - |
| Integration event | OnBeforeMakeSingleLevelAdjmt | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Boolean) | 21-28 | - | - |
| Integration event | OnAdjustItemAvgCostOnBeforeAdjustValueEntries | () | 21-28 | - | - |
| Integration event | OnAvgValueEntriesToAdjustExistOnBeforeIsNotAdjustment | (var Record Value Entry, var Record Value Entry) | 21-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnBeforeCollectAvgCostAdjmtEntryPointToUpdate | (var Record Item) | 21-28 | - | - |
| Integration event | OnInitializeAdjmtOnAfterGetPostingDate | (var Date) | 22-28 | - | - |
| Integration event | OnAdjustAppliedInbndEntriesOnAfterSetFilter | (var Record Value Entry) | 22-28 | - | - |
| Integration event | OnCreateIndirectCostAdjmtOnAfterPostItemJnlLine | (Record Value Entry, Decimal, Decimal) | 22-28 | - | - |
| Integration event | OnPostAdjmtBufOnAfterPostExpectedCost | (Record Value Entry, Record Inventory Adjustment Buffer) | 22-28 | - | - |
| Integration event | OnPostAdjmtBufOnAfterPostNewCost | (Record Value Entry, Record Inventory Adjustment Buffer) | 22-28 | - | - |
| Integration event | OnBeforeOpenWindow | (var Boolean, var Dialog, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeUpdateAdjmtBuf | (Record Value Entry, Decimal, Decimal, Date, Enum Cost Entry Type, var Boolean, var Boolean, var Record Item) | 23-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnAfterLevelExceeded | (var Record Item) | 23-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnBeforePostAdjmtBuf | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Record Inventory Adjustment Buffer, var Record Rounding Residual Buffer, Date, Record Currency, Boolean, var Record Job, Codeunit Item Jnl.-Post Line, var Boolean) | 23-28 | Pending 26.0 | Record parameter TempJobToAdjustBuf is replaced with list parameter JobsToAdjust |
| Integration event | OnForwardAppliedCostOnBeforeUpdateWindow | (var Record Item Ledger Entry, var Record Item) | 23-28 | - | - |
| Integration event | OnAdjustAppliedOutbndEntriesOnBeforeCheckExpectedCost | (var Record Item, var Record Value Entry) | 23-28 | - | - |
| Integration event | OnCalcInbndEntryAdjustedCostOnBeforeAddCost | (var Record Item, var Record Value Entry) | 23-28 | - | - |
| Integration event | OnAdjustItemAvgCostOnBeforeUpdateWindow | (var Record Item) | 23-28 | - | - |
| Integration event | OnUpdateAdjmtBufOnBeforeHasNewCost | (Record Value Entry, Decimal, Decimal, Date, Enum Cost Entry Type, var Boolean, var Record Inventory Adjustment Buffer, var Record Item) | 23-28 | - | - |
| Integration event | OnUpdateWindowOnAfterOpenWindow | (var Boolean) | 23-28 | - | - |
| Integration event | OnCalcAvgCostOnAfterAssignRoundingError | (var Decimal, var Decimal, var Record Cost Element Buffer) | 23-28 | - | - |
| Integration event | OnAdjustOutbndAvgEntryOnNewCostElementBuf | (var Record Value Entry) | 23-28 | - | - |
| Integration event | OnUpdateAdjmtBufOnAfterAddActualCostBuf | (Record Value Entry, Decimal, Decimal, Date, Record Inventory Adjustment Buffer) | 23-28 | - | - |
| Integration event | OnEliminateRndgResidualOnBeforeCheckHasNewCost | (Record Item Ledger Entry, Record Value Entry, Decimal, Decimal, var Boolean) | 23-28 | - | - |
| Integration event | OnBeforeAdjustItem | (var Record Item) | 24-28 | - | - |
| Integration event | OnAfterAdjustItem | (var Record Item) | 24-28 | - | - |
| Integration event | OnEliminateRndgResidualOnAfterCalcInboundCost | (var Record Value Entry, Integer) | 24-28 | - | - |
| Integration event | OnBeforeCollectItemLedgerEntryTypesUsed | (var Record Item, var Boolean) | 24-28 | - | - |
| Integration event | OnBeforeMakeMultiLevejAdjmtOnAfterGetParameters | (var Codeunit Cost Adjustment Params Mgt.) | 26-28 | - | - |
| Integration event | OnBeforeUpdateItemUnitCost2 | (var Record Avg. Cost Adjmt. Entry Point, var Boolean, var Record Item, var Dictionary) | 26-28 | - | - |
| Integration event | OnBeforeRunUpdateJobItemCost | (var List) | 26-28 | - | - |
| Integration event | OnMakeSingleLevelAdjmtOnBeforePostAdjmtBuf2 | (var Record Item, var Record Avg. Cost Adjmt. Entry Point, var Record Inventory Adjustment Buffer, var Record Rounding Residual Buffer, Date, Record Currency, Boolean, var List, Codeunit Item Jnl.-Post Line, var Boolean) | 26-28 | - | - |
| Integration event | OnAdjustItemAppliedCostForItemLedgerEntry | (var Record Item Ledger Entry) | 26 | - | - |
| Integration event | OnAdjustAppliedOutbndEntry | (var Record Item Ledger Entry) | 26-28 | - | - |
| Integration event | OnAdjustAppliedInbndEntry | (var Record Item Ledger Entry) | 26-28 | - | - |
| Integration event | OnAdjustAppliedInbndTransEntry | (var Record Item Ledger Entry) | 26-28 | - | - |
| Integration event | OnBeforeAvgCostAdjmtEntryPoint | (var Record Avg. Cost Adjmt. Entry Point) | 26-28 | - | - |
| Integration event | OnBeforeIteratingOverOutbndAvgEntries | (var Record Value Entry, var Record Avg. Cost Adjmt. Entry Point, Integer) | 26-28 | - | - |
| Integration event | OnAdjustOutbndAvgEntry | (var Record Value Entry) | 26-28 | - | - |
| Integration event | OnExcludeAvgCostOnValuationDate | (var Record Value Entry) | 26-28 | - | - |
| Integration event | OnBeforeIsExcludeFromAvgCostForRevalPoint | (var Record Integer, var Record Value Entry, var Record Value Entry) | 26-28 | - | - |
| Integration event | OnMakeWIPAdjmt | (var Record Inventory Adjmt. Entry (Order)) | 26-28 | - | - |
| Integration event | OnMakeAssemblyAdjmt | (var Record Inventory Adjmt. Entry (Order)) | 26-28 | - | - |
| Integration event | OnAfterSetParameters | (var Record Cost Adjustment Parameter) | 26-28 | Pending 27.0 | This event is never raised. |
| Integration event | OnExcludeAvgCostOnValuationDateOnAfterGetItemApplicationTrace | (var Record Value Entry, var Record Item Application Trace) | 26-28 | - | - |
| Integration event | OnIsOutputWithSelfConsumptionOnAfterGetItemApplicationTrace | (var Record Item Application Trace) | 26-28 | - | - |
| Integration event | OnCalcInbndEntryAdjustedCostOnBeforeCalcNewAdjustedCost | (var Record Cost Element Buffer, Record Item Application Entry, Record Item Ledger Entry, var Boolean) | 26-28 | - | - |
| Integration event | OnPostAdjmtBufOnBeforePostNewCost | (var Record Item Journal Line, Record Value Entry, Record Inventory Adjustment Buffer) | 27-28 | - | - |
| Integration event | OnAdjustItemAppliedCostForItemLedgerEntry | (var Record Item Ledger Entry, var Boolean) | 27-28 | - | - |
| Integration event | OnCalcCostPerUnitOnBeforeCalcCostPerUnit | (var Record Value Entry, Record Cost Element Buffer, var Boolean, var Boolean) | 27-28 | - | - |
| Integration event | OnCalcTransEntryOldCostOnBeforeProcessTransValueEntry | (var Record Value Entry, var Boolean) | 27-28 | - | - |
| Integration event | OnAdjustAppliedOutbndEntriesOnBeforeAdjustEntry | (var Record Item Ledger Entry, var Boolean) | 27 | - | - |
| Integration event | OnAfterInitRndgResidualItemJnlLine | (var Record Item Journal Line, Record Value Entry) | 27-28 | - | - |
| Integration event | OnAdjustAppliedOutbndEntriesOnBeforeAdjustEntry | (var Record Item Ledger Entry, var Record Value Entry, var Boolean) | 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.
