---
id: object/codeunit/6212
type: object
title: Codeunit 6212 "Sustainability Post Mgt"
summary: Codeunit 6212 "Sustainability Post Mgt" in Sustainability (Microsoft.Sustainability.Posting). 21 public procedures, 2 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - sustainability
versions:
  introduced: "29"
  last_changed: null
  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: 8a9c0952d90767e13f2eec5b64c9e7a94a3151474d8e170dd241c62475b05ed8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Sustainability/app/src/Posting/SustainabilityPostMgt.Codeunit.al
    title: src/Apps/W1/Sustainability/app/src/Posting/SustainabilityPostMgt.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/10541
    - change/bcapps/11359
    - change/bcapps/10613
    - change/bcapps/10293
    - change/bcapps/10051
    - change/bcapps/9613
object_type: codeunit
object_id: 6212
name: Sustainability Post Mgt
namespace: Microsoft.Sustainability.Posting
app: Sustainability
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 35
  events: 2
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 1
  calls: 3
  called_by: 17
  implements: 0
---

# Codeunit 6212 "Sustainability Post Mgt"

> Codeunit 6212 "Sustainability Post Mgt" in Sustainability (Microsoft.Sustainability.Posting). 21 public procedures, 2 events. Introduced in BC29, still in BC30.

Sustainability · Microsoft.Sustainability.Posting · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Sustainability/app/src/Posting/SustainabilityPostMgt.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Sustainability Ledger Entry" = i, tabledata "Sustainability Value Entry" = i, tabledata "Sust. G/L - Sust. Ledger Rel." = ri, tabledata "Sust. Jnl. Line G/L Entry" = r |

## Events published

- `OnBeforeInsertSustainabilityLedgerEntry(var SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; SustainabilityJnlLine: Record "Sustainability Jnl. Line")` (integration)
- `OnInsertLedgerEntryOnBeforeInsert(var SustainabilityLedgerEntry: Record "Sustainability Ledger Entry"; var IsHandled: Boolean)` (internal)
  - subscribers: [Codeunit 6228 "Sust. Preview Posting Handler"](../codeunit/6228.md) OnInsertLedgerEntryOnBeforeInsert

## Procedures

- `InsertLedgerEntry(SustainabilityJnlLine: Record "Sustainability Jnl. Line")`
- `InsertValueEntry(SustainabilityJnlLine: Record "Sustainability Jnl. Line"; ValueEntry: Record "Value Entry"; ItemLedgerEntry: Record "Item Ledger Entry")`
- `InsertValueEntry(SustainabilityJnlLine: Record "Sustainability Jnl. Line"; JobLedgerEntry: Record "Job Ledger Entry")`
- `InsertValueEntry(SustainabilityJnlLine: Record "Sustainability Jnl. Line"; ResourceLedgerEntry: Record "Res. Ledger Entry")`
- `InsertValueEntry(SustainabilityJnlLine: Record "Sustainability Jnl. Line"; FALedgerEntry: Record "FA Ledger Entry")`
- `UpdateCO2ePerUnit(SustValueEntry: Record "Sustainability Value Entry")`
- `ResetFilters(var SustainabilityJnlLine: Record "Sustainability Jnl. Line")`
- `UpdateCarbonFeeEmission(var SustainabilityLedgerEntry: Record "Sustainability Ledger Entry")`
- `UpdateCarbonFeeEmissionForValueEntry(var SustainabilityValueEntry: Record "Sustainability Value Entry"; SustainabilityJnlLine: Record "Sustainability Jnl. Line")`
- `UpdateCarbonFeeEmissionValues(ScopeType: Enum "Emission Scope"; PostingDate: Date; CountryRegionCode: Code[10]; EmissionCO2: Decimal; EmissionN2O: Decimal; EmissionCH4: Decimal; var CO2eEmission: Decimal; var CarbonFee: Decimal): Decimal`
- `GetTotalCO2eAmount(ItemLedgerEntry: Record "Item Ledger Entry"; ValueEntryType: Enum "Capacity Type Journal"; var TotalCO2e: Decimal; CO2ePerUnit: Decimal)`
- `GetCO2eAmountAndQuantity(ItemLedgerEntryNo: Integer; var CO2eAmount: Decimal; var CO2eQuantity: Decimal)`
- `GetTotalCO2eAmountFromValueEntry(ItemLedgerEntryDocumentType: Enum "Item Ledger Document Type"; DocumentNo: Code[20]; DocumentLineNo: Integer; ItemNo: Code[20]; var TotalCO2eAmount: Decimal; var TotalCO2eQuantity: Decimal)`
- `IsCarbonTrackingSpecificItem(ItemNo: Code[20]): Boolean`
- `GetStartPostingProgressMessage(): Text` (internal)
- `GetCheckJournalLineProgressMessage(LineNo: Integer): Text` (internal)
- `GetProgressingLineMessage(LineNo: Integer): Text` (internal)
- `GetJnlLinesPostedMessage(): Text` (internal)
- `GetPostConfirmMessage(): Text` (internal)
- `SetSkipUpdateCarbonEmissionValue(NewSkipUpdateCarbonEmissionValue: Boolean)` (internal)
- `SetNextGLEntryNo(NewGLEntryNo: Integer)` (internal)

Plus 12 local procedures.

## 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 8703 "Feature Telemetry"](../codeunit/8703.md) (4 calls: `InsertLedgerEntry → LogUptake`, `InsertLedgerEntry → LogUsage`, `InsertValueEntry → LogUptake`, …)
- [Codeunit 5801 "Show Applied Entries"](../codeunit/5801.md) (2 calls: `GetTotalCO2eAmount → FindAppliedEntries`, `ResolveTransferInCO2e → FindAppliedEntries`)
- [Codeunit 6257 "SustCostManagement"](../codeunit/6257.md) (1 call: `UpdateCO2ePerUnit → UpdateCO2ePerUnit`)

## Called by

- [Codeunit 6213 "Sustainability Jnl.-Post"](../codeunit/6213.md) (7 calls: `CheckJournalLinesBeforePosting → GetCheckJournalLineProgressMessage`, `OnRun → GetJnlLinesPostedMessage`, `OnRun → GetPostConfirmMessage`, …)
- [Codeunit 6214 "Sustainability Recur Jnl.-Post"](../codeunit/6214.md) (7 calls: `CheckAndMarkRecurringLinesBeforePosting → GetCheckJournalLineProgressMessage`, `OnRun → GetJnlLinesPostedMessage`, `OnRun → GetPostConfirmMessage`, …)
- [Codeunit 6225 "Sust. Purchase Subscriber"](../codeunit/6225.md) (5 calls: `CheckAndUpdateSustainabilityInvoicePostingBuffer → UpdateCarbonFeeEmissionValues`, `CheckAndUpdateSustainabilityItemChargeAssignmentPurch → UpdateCarbonFeeEmissionValues`, `CheckAndUpdateSustainabilityItemJournalLine → UpdateCarbonFeeEmissionValues`, …)
- [Codeunit 6256 "Sust. Item Post Subscriber"](../codeunit/6256.md) (5 calls: `GetTotalCO2eFromProdOrder → IsCarbonTrackingSpecificItem`, `OnSetupSplitJnlLineOnAfterSetupTempSplitItemJnlLine → GetCO2eAmountAndQuantity`, `OnSetupSplitJnlLineOnAfterSetupTempSplitItemJnlLine → IsCarbonTrackingSpecificItem`, …)
- [Codeunit 6251 "Sust. Gen. Journal Subscriber"](../codeunit/6251.md) (3 calls: `PostSustainabilityLine → InsertLedgerEntry`, `PostSustainabilityLine → SetNextGLEntryNo`, `PostSustainabilityLine → SetSkipUpdateCarbonEmissionValue`)
- [Codeunit 6255 "Sust. Assembly Subscriber"](../codeunit/6255.md) (3 calls: `OnAfterPostedAssemblyLineInsert → GetTotalCO2eAmountFromValueEntry`, `OnAfterPostedAssemblyLineInsert → IsCarbonTrackingSpecificItem`, `UpdatePostedSustainabilityTotalCO2eOnAssemblyLine → IsCarbonTrackingSpecificItem`)
- [Codeunit 6252 "Sust. Sales Copy Document"](../codeunit/6252.md) (2 calls: `GetTotalCO2eFromSalesInvLine → GetTotalCO2eAmount`, `GetTotalCO2eFromSalesInvLine → IsCarbonTrackingSpecificItem`)
- [Codeunit 6283 "Sust. FA Journal Subscriber"](../codeunit/6283.md) (2 calls: `PostSustainabilityLine → InsertLedgerEntry`, `PostSustainabilityLine → SetSkipUpdateCarbonEmissionValue`)
- [Codeunit 6263 "Sust. Job Post Subscriber"](../codeunit/6263.md) (1 call: `PostSustainabilityValueEntry → InsertValueEntry`)
- [Codeunit 6274 "Sust. Excise Cal. Mgt"](../codeunit/6274.md) (1 call: `InsertExciseJournalLineFromPurchaseInvoiceLine → UpdateCarbonFeeEmissionValues`)
- [Codeunit 6284 "Sust. FA Post Subscriber"](../codeunit/6284.md) (1 call: `PostSustainabilityValueEntry → InsertValueEntry`)
- [Codeunit 6286 "Sust. Resource Post Subscriber"](../codeunit/6286.md) (1 call: `PostSustainabilityValueEntry → InsertValueEntry`)
- [Report 6213 "Batch Update Carbon Emission"](../report/6213.md) (1 call: `UpdateCarbonEmission → UpdateCarbonFeeEmission`)
- [Report 6214 "Sust. Calculate CO2e"](../report/6214.md) (1 call: `UpdateCO2ePerUnit → UpdateCarbonFeeEmissionValues`)
- [Report 6215 "Sust. Item Calculate CO2e"](../report/6215.md) (1 call: `UpdateCO2ePerUnit → UpdateCarbonFeeEmissionValues`)
- [Report 6217 "Sust. Resource Calculate CO2e"](../report/6217.md) (1 call: `UpdateCO2ePerUnit → UpdateCarbonFeeEmissionValues`)
- [Report extension 6299 "Sust. Standard Sales Invoice"](../reportextension/6299.md) (1 call: `UseItemTrackingDetails → IsCarbonTrackingSpecificItem`)

## Recent changes

- 2026-09-16 [#10541 [Master] - Slice 641375: [Sustainability] Collect Amount from G/L Entries: track collected entries to prevent double counting](../../changes/bcapps/10541.md) (main, BC30, feature)
- 2026-09-15 [#11359 [Master] - Bug 648886: [Sustainability][Value Chain] Transfer Order uses average emissions instead of Specific carbon tracking (lot/serial)](../../changes/bcapps/11359.md) (main, BC30, fix)
- 2026-09-01 [#10613 [Master] - Slice 640775: [Sustainability] Reverse Sustainability part when reverse in GL Entries](../../changes/bcapps/10613.md) (main, BC30, feature)
- 2026-08-20 [#10293 [Master] - Bug 641309: [Sustainability][Value Chain] Item Reclassification (location move) uses average emissions instead of Specific carbon tracking (lot/serial)](../../changes/bcapps/10293.md) (main, BC30, fix)
- 2026-08-19 [#10051 Bug 642053: [master] [Sustainability] Preview Posting Creates Gaps in Sustainability Ledger Entry Numbers](../../changes/bcapps/10051.md) (main, BC30, fix)
- 2026-07-29 [#9613 [Master] - Sustainability: Specific Carbon Tracking, Item Charge emissions & setup fixes (Bugs 641051, 641486, 641487, 641049, 641222, 641055, 641289, 641224, 641309)](../../changes/bcapps/9613.md) (main, BC30, fix)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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: "Sustainability Post Mgt")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
