---
id: object/codeunit/5896
type: object
title: Codeunit 5896 "Calc. Inventory Adjmt. - Order"
summary: Codeunit 5896 "Calc. Inventory Adjmt. - Order" in Base Application (Microsoft.Inventory.Costing). 6 public procedures, 15 events. Present since at least BC23, still in BC30, changed in BC25-27, BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "30"
  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: 09f5f175a7acc12bd71e3020f2e458e11a0264f91149ca41c8c34bc10ccfebed
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al
    title: src/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/12066
    - change/bcapps/9398
object_type: codeunit
object_id: 5896
name: Calc. Inventory Adjmt. - Order
namespace: Microsoft.Inventory.Costing
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "26"
  - "27"
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 32
  events: 15
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 1
  calls: 1
  called_by: 5
  implements: 0
---

# Codeunit 5896 "Calc. Inventory Adjmt. - Order"

> Codeunit 5896 "Calc. Inventory Adjmt. - Order" in Base Application (Microsoft.Inventory.Costing). 6 public procedures, 15 events. Present since at least BC23, still in BC30, changed in BC25-27, BC30.

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

## Properties

| Property | Value |
|---|---|
| Permissions | TableData Microsoft.Manufacturing.Capacity."Capacity Ledger Entry" = r, TableData "Inventory Adjmt. Entry (Order)" = rimd |

## Events published

- `OnAfterUpdateOutputAdjmtBuf(InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; ItemLedgerEntry: Record "Item Ledger Entry"; var InventoryAdjustmentBuffer: Record "Inventory Adjustment Buffer")` (integration)
- `OnBeforeUpdateOutputAdjmtBuf(InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; ItemLedgerEntry: Record "Item Ledger Entry"; var InventoryAdjustmentBuffer: Record "Inventory Adjustment Buffer")` (integration)
- `OnBeforeCalcActualCapacityCosts(var InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var IsHandled: Boolean)` (integration)
- `OnBeforeAddCosts(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; ItemLedgerEntryNo: Integer; var isHandled: Boolean)` (integration)
- `OnBeforeCalcActualMaterialCosts(var InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var IsHandled: Boolean)` (integration)
- `OnCalcActualCapacityCostsOnAfterSetFilters(var CapLedgEntry: Record Microsoft.Manufacturing.Capacity."Capacity Ledger Entry"; var InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var IsHandled: Boolean; ShareOfTotalCapCost: Decimal)` (integration, obsolete 27.0)
- `OnCalcActualMaterialCostsOnAfterSetFilters(var ItemLedgEntry: Record "Item Ledger Entry"; var InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var CalculateActualMaterialCost: Query "Calculate Actual Material Cost"; var IsHandled: Boolean)` (integration)
- `OnCalcOutputQtyOnAfterSetFilters(var ItemLedgEntry: Record "Item Ledger Entry"; var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)")` (integration)
- `OnCalculateOnAfterGetItem(var Item: Record Item; var SourceInvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)")` (integration)
- `OnOutputItemLedgEntryExistOnAfterSetFilters(var FromItemLedgEntry: Record "Item Ledger Entry"; var SourceInvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)")` (integration)
- `OnCalcOutputEntryCostAdjmtsOnBeforeCalculateCostForGrossOutput(var NewActInvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; RemOutputQty: Decimal; OutputQty: Decimal)` (integration)
- `OnBeforeCalcStandardCost(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; OutputQty: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeCalcShareOfCapCost(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var ShareOfCapCost: Decimal; var IsHandled: Boolean)` (integration, obsolete 27.0)
- `OnAfterCalcExactCostReversingQty(ItemLedgEntry: Record "Item Ledger Entry"; var Qty: Decimal)` (integration)
- `OnCalcActualCapacityCostsInternal(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)")` (internal)
  - subscribers: [Codeunit 99000776 "Mfg. InventoryAdjmtEntryOrder"](../codeunit/99000776.md) OnCalcActualCapacityCostsInternal

## Procedures

- `Calculate(SourceInvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var InvtAdjmtBuf: Record "Inventory Adjustment Buffer")`
- `CalcActualUsageCosts(SourceInvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; OutputQty: Decimal; var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)")`
- `AdjustForRevNegCon(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; ItemLedgEntryNo: Integer)`
- `CalcOutputQty(InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; OnlyInbounds: Boolean): Decimal`
- `RunOnCalcActualCapacityCostsOnAfterSetFilters(var CapLedgEntry: Record Microsoft.Manufacturing.Capacity."Capacity Ledger Entry"; var InventoryAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var IsHandled: Boolean; ShareOfTotalCapCost: Decimal)` (internal)
- `RunOnBeforeCalcShareOfCapCost(var InvtAdjmtEntryOrder: Record "Inventory Adjmt. Entry (Order)"; var ShareOfCapCost: Decimal; var IsHandled: Boolean)` (internal)

Plus 11 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 5836 "Cost Calculation Management"](../codeunit/5836.md) (3 calls: `CalcActualMaterialCosts → CanIncNonInvCostIntoProductionItem`, `CalcActualOutputCosts → CanIncNonInvCostIntoProductionItem`, `UpdateOutputAdjmtBuf → CanIncNonInvCostIntoProductionItem`)

## Called by

- [Codeunit 5895 "Inventory Adjustment"](../codeunit/5895.md) (2 calls: `MakeAssemblyAdjmt → Calculate`, `MakeWIPAdjmt → Calculate`)
- [Codeunit 99000758 "Mfg. Cost Calculation Mgt."](../codeunit/99000758.md) (2 calls: `CalcProdOrderLineActCost → CalcActualUsageCosts`, `CalcProdOrderLineActCost → CalcOutputQty`)
- [Report 5848 "Cost Shares Breakdown"](../report/5848.md) (2 calls: `UpdateCostShareBufFromInvAdjmtEntryOrder → CalcActualUsageCosts`, `UpdateCostShareBufFromInvAdjmtEntryOrder → CalcOutputQty`)
- [Table 900 "Assembly Header"](../table/900.md) (1 call: `CalcActualCosts → CalcActualUsageCosts`)
- [Table 910 "Posted Assembly Header"](../table/910.md) (1 call: `CalcActualCosts → CalcActualUsageCosts`)

## Recent changes

- 2026-10-02 [#12066 Bugs/remove asm inv mfg clean27 tags for wave2 2026](../../changes/bcapps/12066.md) (main, BC30, obsoletion)
- 2026-07-24 [#9398 [Main]Incorrect Cost Amount (Actual) in Value Entries after posting Assembly Process and calulating the assembly standard costsInitial commit](../../changes/bcapps/9398.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25-27, BC30

## Deprecations

- procedure RunOnBeforeCalcShareOfCapCost: guarded (#if not CLEAN27)
- procedure RunOnCalcActualCapacityCostsOnAfterSetFilters: guarded (#if not CLEAN27)
- procedure OnBeforeCalcShareOfCapCost: Pending 27.0 (#if not CLEAN27), "Moved to codeunit MfgInventoryAdjmtEntryOrder"
- procedure OnCalcActualCapacityCostsOnAfterSetFilters: Pending 27.0 (#if not CLEAN27), "Moved to codeunit MfgInventoryAdjmtOrder"

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: "Calc. Inventory Adjmt. - Order")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
