---
id: object/codeunit/912
type: object
title: Codeunit 912 "Calculate Assembly Cost"
summary: Codeunit 912 "Calculate Assembly Cost" in Base Application (Microsoft.Assembly.Costing). 9 public procedures, 14 events, 1 event subscribers. Introduced in BC26, still in BC30, changed in BC27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: "26"
  last_changed: "27"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: c9ff03c9f960f43b68df1a318181e85316f298255fd088b039077aca7137cfe0
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Assembly/Costing/CalculateAssemblyCost.Codeunit.al
    title: src/Layers/W1/BaseApp/Assembly/Costing/CalculateAssemblyCost.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 912
name: Calculate Assembly Cost
namespace: Microsoft.Assembly.Costing
app: Base Application
extends: null
first_version: "26"
last_version: "30"
present_in:
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 37
  events: 14
  subscribers: 1
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 4
  called_by: 3
  implements: 0
---

# Codeunit 912 "Calculate Assembly Cost"

> Codeunit 912 "Calculate Assembly Cost" in Base Application (Microsoft.Assembly.Costing). 9 public procedures, 14 events, 1 event subscribers. Introduced in BC26, still in BC30, changed in BC27.

Base Application · Microsoft.Assembly.Costing · BC26-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Assembly/Costing/CalculateAssemblyCost.Codeunit.al) · facts from BC29

## Events published

- `OnAfterSetProperties(var NewCalculationDate: Date; var NewCalcMultiLevel: Boolean; var NewLogErrors: Boolean; var NewStdCostWkshName: Text[50]; var NewShowDialog: Boolean)` (integration)
- `OnBeforeCalcItems(var Item: Record Item)` (integration)
- `OnBeforeCalcItem(var Item: Record Item; var IsHandled: Boolean)` (integration)
- `OnCalcAssemblyItemOnAfterInitItemCost(var Item: Record Item)` (integration)
- `OnCalcAssemblyItemOnAfterCalcItemRolledupCost(var Item: Record Item)` (integration)
- `OnCalcAssemblyItemOnAfterCalcSingleLevelCost(var Item: Record Item)` (integration)
- `OnCalcAssemblyItemOnAfterCalcItemCost(var Item: Record Item; CompItem: Record Item; BOMComponent: Record "BOM Component"; ComponentQuantity: Decimal)` (integration)
- `OnCalcItemOnBeforeShowStrMenu(var Item: Record Item; var ShowStrMenu: Boolean; var NewCalcMultiLevel: Boolean)` (integration)
- `OnCalcItemOnAfterCalcShowConfirm(Item: Record Item; var CalcMfgItems: Boolean; var ShowConfirm: Boolean)` (integration)
- `OnAfterGetItem(var Item: Record Item; StdCostWkshName: Text[50]; IsInBuffer: Boolean)` (integration)
- `OnBeforeSetProperties(var NewCalculationDate: Date; var NewCalcMultiLevel: Boolean; var NewLogErrors: Boolean; var NewStdCostWkshName: Text[50]; var NewShowDialog: Boolean)` (integration)
- `OnBeforeDoCalcAssemblyItemPrice(var Item: Record Item; Level: Integer; MaxLevel: Integer; CalcMultiLevel: Boolean; var IsHandled: Boolean)` (integration)
- `OnDoCalcAssemblyItemPriceOnAfterSetBOMCompFilters(var Item: Record Item; var BOMComponent: Record "BOM Component")` (integration)
- `OnGetResCostOnBeforeAssignPriceListLineToTemp(var PriceListLine: Record "Price List Line"; var TempItem: Record Item temporary; StdCostWkshName: Text[50])` (integration)

## Event subscriptions

- OnAfterGetItemCosts subscribes to Table "Microsoft.Manufacturing.StandardCost."Standard Cost Worksheet"" OnAfterGetItemCosts

## Procedures

- `SetProperties(NewCalculationDate: Date; NewCalcMultiLevel: Boolean; NewLogErrors: Boolean; NewStdCostWkshName: Text[50]; NewShowDialog: Boolean)`
- `TestPreconditions(var Item: Record Item)`
- `CalcItem(ItemNo: Code[20])`
- `CalcItems(var Item: Record Item; var NewTempItem: Record Item)`
- `CalcAssemblyItemPrice(ItemNo: Code[20])`
- `CalculateAssemblyCostExp(AssemblyHeader: Record "Assembly Header"; var ExpCost: array[5] of Decimal)`
- `CalcOverHeadAmt(CostAmt: Decimal; IndirectCostPct: Decimal; OverheadRateAmt: Decimal): Decimal`
- `CalcAsmOrderStatistics(AssemblyHeader: Record "Assembly Header"; var Value: array[5, 5] of Decimal)`
- `CalcPostedAsmOrderStatistics(PostedAssemblyHeader: Record "Posted Assembly Header"; var Value: array[5, 5] of Decimal)`

Plus 13 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 5402 "Unit of Measure Management"](../codeunit/5402.md) (4 calls: `CalcAssemblyItem → GetQtyPerUnitOfMeasure`, `CalcAssemblyItem → GetResQtyPerUnitOfMeasure`, `DoCalcAssemblyItemPrice → GetQtyPerUnitOfMeasure`, …)
- [Codeunit 5804 "ItemCostManagement"](../codeunit/5804.md) (1 call: `CalcItem → UpdateStdCostShares`)
- [Codeunit 5836 "Cost Calculation Management"](../codeunit/5836.md) (1 call: `GetResCost → CalcDirUnitCost`)
- [Codeunit 7001 "Price Calculation Mgt."](../codeunit/7001.md) (1 call: `FindResourceCost → GetHandler`)

## Called by

- [Page 916 "Assembly Order Statistics"](../page/916.md) (1 call: `OnAfterGetRecord → CalcAsmOrderStatistics`)
- [Page 923 "Posted Asm. Order Statistics"](../page/923.md) (1 call: `OnAfterGetRecord → CalcPostedAsmOrderStatistics`)
- [Table 900 "Assembly Header"](../table/900.md) (1 call: `UpdateUnitCost → CalcOverHeadAmt`)

## Across versions

- Present in: BC26-30
- Changed (declaration) in: BC27

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Calculate Assembly Cost")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
