---
title: "Codeunit 5812 Calculate Standard Cost"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5812-calculate-standard-cost/
type: codeunit
id: 5812
name: "Calculate Standard Cost"
app: "Base Application"
namespace: Microsoft.Manufacturing.StandardCost
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5812-calculate-standard-cost/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 5812 Calculate Standard Cost

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5812-calculate-standard-cost/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Manufacturing.StandardCost |
| Versions | 17-28 |
| Source file | Manufacturing/StandardCost/CalculateStandardCost.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| SetProperties | (Date, Boolean, Boolean, Boolean, Text[50], Boolean) | - | public | 17-28 | - | - |
| TestPreconditions | (var Record Item, var Record Production BOM Version, var Record Routing Version) | - | public | 17-28 | - | - |
| CalcItem | (Code[20], Boolean) | - | public | 17-28 | - | - |
| CalcItems | (var Record Item, var Record Item) | - | public | 17-28 | - | - |
| CalcAssemblyItemPrice | (Code[20]) | - | public | 17-28 | - | - |
| CalculateAssemblyCostExp | (Record Assembly Header, var Decimal) | - | public | 17-28 | - | - |
| CalcOverHeadAmt | (Decimal, Decimal, Decimal) | Decimal | public | 17-28 | - | - |
| CalcAsmOrderStatistics | (Record Assembly Header, var Decimal) | - | public | 17-28 | - | - |
| CalcPostedAsmOrderStatistics | (Record Posted Assembly Header, var Decimal) | - | public | 17-28 | - | - |
| CalcRtngLineCost | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal) | - | public | 17-28 | - | - |
| CalcRtngLineCost | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal, var Record Item) | - | internal | 25-28 | - | - |
| CalcItemForNonInventoryValue | (var Record Item) | - | public | 26-28 | Pending 27.0 | procedure that was implemented to throw the error has now been identified as unnecessary |
| CalcSKUForNonInventoryValue | (var Record Stockkeeping Unit) | - | public | 26-28 | Pending 27.0 | procedure that was implemented to throw the error has now been identified as unnecessary |
| CalcItemSKU | (Code[20], Code[20], Code[20]) | - | public | 26-28 | - | - |
| CalcRtngLineCostSKU | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal) | - | internal | 26-28 | - | - |
| RunOnBeforeCalcItems | (var Record Item) | - | internal | 26-28 | - | - |
| RunOnBeforeCalcItem | (var Record Item, Boolean, var Boolean) | - | internal | 26-28 | - | - |
| RunOnCalcAssemblyItemOnAfterInitItemCost | (var Record Item) | - | internal | 26-28 | - | - |
| RunOnCalcAssemblyItemOnAfterCalcItemRolledupCost | (var Record Item) | - | internal | 26-28 | - | - |
| RunOnCalcAssemblyItemOnAfterCalcSingleLevelCost | (var Record Item) | - | internal | 26-28 | - | - |
| RunOnCalcAssemblyItemOnAfterCalcItemCost | (var Record Item, Record Item, Record BOM Component, Decimal) | - | internal | 26-28 | - | - |
| RunOnAfterGetItem | (var Record Item, Text[50], Boolean) | - | internal | 26-28 | - | - |
| RunOnBeforeDoCalcAssemblyItemPrice | (var Record Item, Integer, Integer, Boolean, var Boolean) | - | internal | 26-28 | - | - |
| RunOnDoCalcAssemblyItemPriceOnAfterSetBOMCompFilters | (var Record Item, var Record BOM Component) | - | internal | 26-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCalcRtngLineCost | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal) | 17-22 | - | - |
| Integration event | OnAfterSetProdBOMFilters | (var Record Production BOM Line, var Code[20], var Code[20]) | 17-28 | - | - |
| Integration event | OnAfterSetProperties | (var Date, var Boolean, var Boolean, var Boolean, var Text[50], var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcItems | (var Record Item) | 17-28 | - | - |
| Integration event | OnBeforeCalcItem | (var Record Item, Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeCalcRtngLineCost | (var Record Routing Line, Decimal) | 17-27 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterInitItemCost | (var Record Item) | 17-28 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterCalcItemRolledupCost | (var Record Item) | 17-28 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterCalcSingleLevelCost | (var Record Item) | 17-28 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterCalcItemCost | (var Record Item, Record Item) | 17-20 | - | - |
| Integration event | OnCalcItemOnBeforeShowStrMenu | (var Record Item, var Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnCalcMfgItemOnBeforeCalcRtngCost | (var Record Item, Integer, var Decimal, var Decimal) | 17-25 | - | - |
| Integration event | OnCalcMfgItemOnBeforeCalculateCosts | (var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Record Item, Decimal, Decimal, Integer, Date, var Decimal) | 17-28 | - | - |
| Integration event | OnCalcProdBOMCostOnAfterCalcCompItemQtyBase | (Date, Record Item, Decimal, Boolean, var Record Production BOM Line, var Decimal, Code[20], Decimal) | 17-28 | - | - |
| Integration event | OnCalcProdBOMCostOnAfterCalcMfgItem | (var Record Production BOM Line, Record Item, Decimal, Record Item, Decimal, Integer, Boolean, Decimal) | 17-22 | - | - |
| Integration event | OnCalcRtngCostOnBeforeCalcRtngLineCost | (var Record Routing Line, Record Item) | 17-23 | - | - |
| Integration event | OnCalcRtngCostPerUnitOnBeforeCalc | (Option, var Decimal, var Decimal, var Decimal, var Decimal, var Option, Record Work Center, Record Machine Center, var Boolean) | 17-25 | Pending 23.0 | Replaced by event OnCalcRoutingCostPerUnitOnBeforeCalc() |
| Integration event | OnGetWorkCenterOnBeforeAssignWorkCenterToTemp | (var Record Work Center, var Record Item) | 17-25 | - | - |
| Integration event | OnBeforeCalcMfgItem | (var Record Item, var Boolean, Text[50]) | 19-28 | - | - |
| Integration event | OnBeforeTestBOMVersionIsCertified | (Code[20], Record Production BOM Header, Boolean, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeTestRtngVersionIsCertified | (Code[20], Record Routing Header, Boolean, var Boolean) | 19-28 | - | - |
| Integration event | OnCalcItemOnAfterCalcShowConfirm | (Record Item, var Boolean, var Boolean) | 20-28 | - | - |
| Integration event | OnCalcProdBOMCostOnAfterCalcAnyItem | (var Record Production BOM Line, Record Item, Decimal, Record Item, Decimal, Integer, Boolean, Decimal) | 20-21 | - | - |
| Integration event | OnAfterGetItem | (var Record Item, Text[50], Boolean) | 20-28 | - | - |
| Integration event | OnBeforeSetProperties | (var Date, var Boolean, var Boolean, var Boolean, var Text[50], var Boolean) | 20-28 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterCalcItemCost | (var Record Item, Record Item, Record BOM Component, Decimal) | 21-27 | - | - |
| Integration event | OnBeforeCalcProdBOMCost | (Record Item, Code[20], Code[20], Decimal, Boolean, Integer, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Boolean) | 21 | - | - |
| Integration event | OnCalcProdBOMCostOnAfterCalcAnyItem | (var Record Production BOM Line, Record Item, Decimal, Record Item, Decimal, Integer, Boolean, Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal) | 22-28 | - | - |
| Integration event | OnBeforeCalcProdBOMCost | (Record Item, Code[20], Code[20], Decimal, Boolean, Integer, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Decimal, var Boolean, var Date, var Boolean, var Record Routing Version, var Record Production BOM Version) | 22-28 | - | - |
| Integration event | OnBeforeDoCalcAssemblyItemPrice | (var Record Item, Integer, Integer, Boolean, var Boolean) | 22-28 | - | - |
| Integration event | OnDoCalcAssemblyItemPriceOnAfterSetBOMCompFilters | (var Record Item, var Record BOM Component) | 22-28 | - | - |
| Integration event | OnAfterCalcRtngLineCost | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal, var Text[50]) | 23-24 | - | - |
| Integration event | OnCalcProdBOMCostOnAfterCalcMfgItem | (var Record Production BOM Line, Record Item, Decimal, Record Item, Decimal, Integer, Boolean, Decimal, var Record Item) | 23-28 | - | - |
| Integration event | OnCalcRoutingCostPerUnitOnBeforeCalc | (Enum Capacity Type Routing, var Decimal, var Decimal, var Decimal, var Decimal, var Enum Unit Cost Calculation Type, Record Work Center, Record Machine Center, var Boolean) | 23-28 | - | - |
| Integration event | OnCalcProdBOMCostOnBeforeCalcCompItemQtyBase | (var Record Production BOM Line, var Record Item, Date, Record Item, Decimal, Boolean, var Decimal, Code[20], Decimal) | 23-28 | - | - |
| Integration event | OnCalcRtngCostOnBeforeCalcRtngLineCost | (var Record Routing Line, Record Item, var Boolean, var Boolean) | 24-28 | - | - |
| Integration event | OnGetResCostOnBeforeAssignPriceListLineToTemp | (var Record Price List Line, var Record Item, Text[50]) | 24-28 | - | - |
| Integration event | OnGetMachineCenterOnBeforeAssignMachineCenterToTemp | (var Record Machine Center, var Record Item, Text[50]) | 24-28 | - | - |
| Integration event | OnCalcRtngLineCostOnAfterCalcRoutingCostPerUnit | (Record Routing Line, Record Work Center, var Decimal, var Enum Unit Cost Calculation Type) | 24-28 | - | - |
| Integration event | OnAfterCalcRtngLineCost | (Record Routing Line, Decimal, var Decimal, var Decimal, var Decimal, var Text[50], var Record Item, Decimal) | 25-28 | - | - |
| Integration event | OnCalcMfgItemOnBeforeCalcRtngCost | (var Record Item, Integer, var Decimal, var Decimal, var Decimal) | 26-28 | - | - |
| Integration event | OnGetWorkCenterOnBeforeAssignWorkCenterToTemp | (var Record Work Center, var Record Item, Text[50]) | 26-28 | - | - |
| Integration event | OnCalcItemsOnBeforeProcessItems | (var Record Item, var Record Item, var Boolean) | 28 | - | - |
| Integration event | OnBeforeCalcRtngLineCost | (var Record Routing Line, Decimal, var Record Item) | 28 | - | - |
| Integration event | OnCalcAssemblyItemOnAfterCalcItemCost | (var Record Item, Record Item, Record BOM Component, var Decimal, var Integer, var Boolean) | 28 | - | - |
| Integration event | OnCalcMfgItemOnAfterCalculateCosts | (Decimal, Decimal, Decimal, Decimal, Decimal, var Record Item, Decimal, Decimal, Integer, Date, Decimal) | 28 | - | - |
| Integration event | OnCalcRtngLineCostOnBeforeCalcRoutingCostPerUnit | (var Record Routing Line, Decimal, var Record Work Center, var Decimal, var Decimal, var Decimal, var Decimal, var Enum Unit Cost Calculation Type, var Record Item, var Boolean) | 28 | - | - |
| Integration event | OnCalcItemOnAfterCalculateCosts | (var Record Item) | 28 | - | - |
| Integration event | OnCalcProdBOMCostOnBeforeNextLineIteration | (var Record Production BOM Line, Code[20], Integer, Decimal, Record Item, Decimal) | 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.
