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

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5804-itemcostmanagement/

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

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| UpdateUnitCost | (var Record Item, Code[10], Code[10], Decimal, Decimal, Boolean, Boolean, Boolean, Integer) | - | public | 17-28 | - | - |
| UpdateStdCostShares | (Record Item) | - | public | 17-28 | - | - |
| UpdateUnitCostSKU | (Record Item, var Record Stockkeeping Unit, Decimal, Decimal, Boolean, Integer) | - | public | 17-28 | - | - |
| CalculateAverageCost | (var Record Item, var Decimal, var Decimal) | Boolean | public | 17-28 | - | - |
| SetFilters | (var Record Value Entry, var Record Item) | - | public | 17-28 | - | - |
| SetProperties | (Boolean, Decimal) | - | public | 17-28 | - | - |
| FindUpdateUnitCostSKU | (Record Item, Code[10], Code[10], Boolean, Decimal) | - | public | 17-28 | - | - |
| IsItemUnitCostUpdated | () | Boolean | public | 18-28 | - | - |
| UpdateStdCostSharesForSKU | (Record Stockkeeping Unit) | - | public | 26-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCalculateQuantity | (var Record Value Entry, var Record Item, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterExcludeOpenOutbndCosts | (var Record Item, var Decimal, var Decimal, var Decimal) | 17-28 | - | - |
| Integration event | OnAfterRecalcStdCostItem | (var Record Item) | 17-28 | - | - |
| Integration event | OnAfterSetFilters | (var Record Value Entry, var Record Item) | 17-28 | - | - |
| Integration event | OnBeforeCalcLastAdjEntryAvgCost | (var Record Item, var Decimal, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalculateCostAmount | (var Record Item, Boolean, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalculateAverageCost | (var Record Item, var Decimal, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcUnitCostFromAverageCost | (var Record Item, var Codeunit Cost Calculation Management, Record General Ledger Setup, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCheckUpdateLastDirectCost | (var Record Item, Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUpdateUnitCost | (var Record Item, Code[10], Code[10], Decimal, Decimal, Boolean, Boolean, Boolean, Integer, var Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUpdateUnitCostSKU | (Record Item, var Record Stockkeeping Unit, Decimal, Decimal, Boolean, Integer, var Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUpdateUnitCostFromLastDirectCost | (var Record Item, Decimal, Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnCalcLastAdjEntryAvgCostOnAfterCalcAverageCost | (Record Item Ledger Entry, Record Value Entry, var Record Item, var Decimal, var Decimal) | 17-28 | - | - |
| Integration event | OnUpdateUnitCostOnAfterCalcRunOnModifyTrigger | (Record Item, var Boolean) | 17-22 | - | - |
| Integration event | OnUpdateUnitCostOnBeforeNetInvoiceQtyCheck | (Record Item, var Boolean) | 17-28 | - | - |
| Integration event | OnUpdateUnitCostOnBeforeUpdateSKU | (var Record Item, var Boolean) | 17-28 | - | - |
| Integration event | OnUpdateUnitCostOnBeforeValidatePriceProfitCalculation | (var Record Item, var Boolean) | 17-28 | - | - |
| Integration event | OnUpdateUnitCostSKUOnBeforeMatchSKU | (var Record Stockkeeping Unit, Record Item) | 17-28 | - | - |
| Integration event | OnUpdateStdCostSharesOnAfterCopyCosts | (var Record Item, Record Item) | 17-28 | - | - |
| Integration event | OnAfterUpdateUnitCost | (var Record Item, Integer) | 17-28 | - | - |
| Integration event | OnUpdateUnitCostSKUOnBeforeCalcNonItemAvgCostCalcType | (Record Item, var Record Stockkeeping Unit, Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnFindUpdateUnitCostSKUOnBeforeLoopUpdateUnitCostSKU | (var Record Stockkeeping Unit, Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUpdateStdCostShares | (var Record Item, var Boolean) | 18-28 | - | - |
| Integration event | OnExcludeOpenOutbndCostsOnAfterOpenItemLedgEntrySetFilters | (var Record Item Ledger Entry, var Record Item) | 18-28 | - | - |
| Integration event | OnCalculateAverageCostOnAfterCalcAverageQty | (var Record Item, var Decimal, var Decimal, var Decimal) | 19-28 | - | - |
| Integration event | OnAfterUpdateUnitCostSKU | (Record Item, var Record Stockkeeping Unit) | 20-28 | - | - |
| Integration event | OnAfterGetGLSetup | (var Record General Ledger Setup) | 21-28 | - | - |
| Integration event | OnUpdateUnitCostSKUOnAfterSetSKUUnitCosts | (var Record Stockkeeping Unit, var Record Item, var Decimal, var Decimal) | 21-28 | - | - |
| Integration event | OnCalculateAverageCostOnAfterCalculateAverage | (var Record Item, var Decimal, var Decimal) | 22-23 | - | - |
| Integration event | OnUpdateUnitCostOnAfterCalcRunOnModifyTrigger | (var Record Item, var Boolean, Integer) | 23-28 | - | - |
| Integration event | OnCalculatePreciseCostAmountsOnAfterFilterOpenInboundItemLedgerEntry | (Record Item Ledger Entry, var Record Item) | 23-28 | - | - |
| Integration event | OnCalculateAverageCostOnAfterCalculateAverage | (var Record Item, var Decimal, var Decimal, var Boolean) | 24-28 | - | - |
| Integration event | OnUpdateUnitCostSKUOnBeforeCheckNegCost | (var Decimal, var Boolean) | 25-28 | - | - |
| Integration event | OnCalcLastAdjEntryAvgCostOnBeforeSetFilters | (var Record Value Entry, var Record Item, var Decimal, var Decimal, var Boolean) | 25-28 | - | - |
| Integration event | OnCalculatePreciseCostAmountsOnBeforeProcessOpenOutboundItemLedgerEntry | (var Record Item, var Record Item Ledger Entry, var Record Item Ledger Entry, var Record Item Ledger Entry, var Boolean) | 25-28 | - | - |
| Integration event | OnCalculatePreciseCostAmountsOnOnBeforeProcessTempItemLedgerEntry | (var Record Item Ledger Entry, var Decimal, var Boolean) | 25-28 | - | - |
| Integration event | OnBeforeCalculatePreciseCostAmounts | (var Record Item, Boolean, Boolean, var Decimal, var Decimal, var Boolean) | 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.
