---
id: object/table/5820
type: object
title: Table 5820 "Cost Element Buffer"
summary: Table 5820 "Cost Element Buffer" in Base Application (Microsoft.Inventory.Costing). 12 fields, 12 public procedures, 6 events. Present since at least BC23, still in BC30, changed in BC24, BC27-28.
tier: official
language: en
tags:
  - table
  - base application
versions:
  introduced: null
  last_changed: "28"
  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: c14e58c1b745ef14fc44bbdf9eb398c5f75db9906e871e325a8845010395d2ed
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Inventory/Costing/CostElementBuffer.Table.al
    title: src/Layers/W1/BaseApp/Inventory/Costing/CostElementBuffer.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: table
object_id: 5820
name: Cost Element Buffer
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:
  - "24"
  - "27"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 12
  procedures: 20
  events: 6
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Table 5820 "Cost Element Buffer"

> Table 5820 "Cost Element Buffer" in Base Application (Microsoft.Inventory.Costing). 12 fields, 12 public procedures, 6 events. Present since at least BC23, still in BC30, changed in BC24, BC27-28.

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

## Properties

| Property | Value |
|---|---|
| Caption | Cost Element Buffer |
| DataClassification | CustomerContent |

## Fields

Explanation: the field's ToolTip in the code; without one, the ToolTip of a page control bound to the field (marked via the page); without that, its Caption (marked caption) when that differs from the name.

| No. | Name | Type | Explanation | Notes |
|---|---|---|---|---|
| 1 | Type | Enum "Cost Entry Type" | — | enum [Enum 104 "Cost Entry Type"](../enum/104.md); DataClassification SystemMetadata |
| 2 | Variance Type | Enum "Cost Variance Type" | — | enum [Enum 106 "Cost Variance Type"](../enum/106.md); DataClassification SystemMetadata |
| 3 | Actual Cost | Decimal | — | DataClassification SystemMetadata |
| 4 | Actual Cost (ACY) | Decimal | — | DataClassification SystemMetadata |
| 5 | Rounding Residual | Decimal | — | DataClassification SystemMetadata |
| 6 | Rounding Residual (ACY) | Decimal | — | DataClassification SystemMetadata |
| 7 | Expected Cost | Decimal | — | DataClassification SystemMetadata |
| 8 | Expected Cost (ACY) | Decimal | — | DataClassification SystemMetadata |
| 9 | Invoiced Quantity | Decimal | — | DataClassification SystemMetadata |
| 10 | Remaining Quantity | Decimal | — | DataClassification SystemMetadata |
| 11 | Inbound Completely Invoiced | Boolean | — | DataClassification SystemMetadata |
| 12 | Last Valid Value Entry No | Integer | — | DataClassification SystemMetadata |

## Keys

- Key1: Type, Variance Type (clustered)

## Events published

- `OnAfterUpdateAvgCostBuffer(var CostElementBuffer: Record "Cost Element Buffer"; CostElementBuf: Record "Cost Element Buffer"; LastValidEntryNo: Integer)` (integration)
- `OnAfterUpdateCostElementBuffer(var CostElementBuffer: Record "Cost Element Buffer"; AvgCostBuf: Record "Cost Element Buffer")` (integration)
- `OnAfterExcludeBufFromAvgCostCalc(var CostElementBuffer: Record "Cost Element Buffer"; InvtAdjmtBuffer: Record "Inventory Adjustment Buffer")` (integration)
- `OnAfterRoundActualCost(var CostElementBuffer: Record "Cost Element Buffer"; ShareOfTotalCost: Decimal; AmtRndgPrec: Decimal; AmtRndgPrecACY: Decimal)` (integration)
- `OnAfterDeductOutbndValueEntryFromBuf(var CostElementBuffer: Record "Cost Element Buffer"; OutbndValueEntry: Record "Value Entry"; CostElementBuf: Record "Cost Element Buffer"; IsAvgCostCalcTypeItem: Boolean)` (integration)
- `OnAfterExcludeEntryFromAvgCostCalc(var CostElementBuffer: Record "Cost Element Buffer"; ValueEntry: Record "Value Entry")` (integration)

## Procedures

- `Initialize(KeepRoundingResidual: Boolean)`
- `AddActualCostElement(NewEntryType: Enum "Cost Entry Type"; NewActualCost: Decimal; NewActualCostACY: Decimal)`
- `AddActualCostElement(NewEntryType: Enum "Cost Entry Type"; ValueEntry: Record "Value Entry")`
- `AddExpectedCostElement(NewEntryType: Enum "Cost Entry Type"; NewExpectedCost: Decimal; NewExpectedCostACY: Decimal)`
- `AddExpectedCostElement(NewEntryType: Enum "Cost Entry Type"; ValueEntry: Record "Value Entry")`
- `RoundActualCost(ShareOfTotalCost: Decimal; AmtRndgPrec: Decimal; AmtRndgPrecACY: Decimal)`
- `ExcludeEntryFromAvgCostCalc(ValueEntry: Record "Value Entry")`
- `ExcludeBufFromAvgCostCalc(InvtAdjmtBuffer: Record "Inventory Adjustment Buffer")`
- `GetElement(NewEntryType: Enum "Cost Entry Type"): Boolean`
- `DeductOutbndValueEntryFromBuf(OutbndValueEntry: Record "Value Entry"; CostElementBuf: Record "Cost Element Buffer"; IsAvgCostCalcTypeItem: Boolean)`
- `UpdateAvgCostBuffer(CostElementBuf: Record "Cost Element Buffer"; LastValidEntryNo: Integer)`
- `UpdateCostElementBuffer(AvgCostBuf: Record "Cost Element Buffer")`

Plus 2 local procedures.

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC27-28

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). 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: "table", object_name: "Cost Element Buffer")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
