---
id: object/codeunit/5496
type: object
title: Codeunit 5496 "Graph Mgt - Sales Order Buffer"
summary: Codeunit 5496 "Graph Mgt - Sales Order Buffer" in Base Application (Microsoft.Integration.Graph). 10 public procedures, 1 events, 8 event subscribers. Present since at least BC23, still in BC30, changed in BC28.
tier: official
language: en
tags:
  - codeunit
  - 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: a2c181377d803516ca5d4a49ab4280a75cac806e1df4391390ab7bde53d267e7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Integration/Graph/GraphMgtSalesOrderBuffer.Codeunit.al
    title: src/Layers/W1/BaseApp/Integration/Graph/GraphMgtSalesOrderBuffer.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: 5496
name: Graph Mgt - Sales Order Buffer
namespace: Microsoft.Integration.Graph
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 37
  events: 1
  subscribers: 8
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 9
  called_by: 7
  implements: 0
---

# Codeunit 5496 "Graph Mgt - Sales Order Buffer"

> Codeunit 5496 "Graph Mgt - Sales Order Buffer" in Base Application (Microsoft.Integration.Graph). 10 public procedures, 1 events, 8 event subscribers. Present since at least BC23, still in BC30, changed in BC28.

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

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Sales Order Entity Buffer" = rimd |

## Events published

- `OnBeforeCheckValidRecord(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)` (integration)

## Event subscriptions

- OnAfterInsertSalesHeader subscribes to Table "Sales Header" OnAfterInsertEvent
- OnAfterModifySalesHeader subscribes to Table "Sales Header" OnAfterModifyEvent
- OnAfterDeleteSalesHeader subscribes to Table "Sales Header" OnAfterDeleteEvent
- OnAfterResetRecalculateInvoiceDisc subscribes to Codeunit "Sales - Calc Discount By Type" OnAfterResetRecalculateInvoiceDisc
- OnAfterInsertSalesLine subscribes to Table "Sales Line" OnAfterInsertEvent
- OnAfterModifySalesLine subscribes to Table "Sales Line" OnAfterModifyEvent
- OnAfterDeleteSalesLine subscribes to Table "Sales Line" OnAfterDeleteEvent
- OnAfterCalculateSalesDiscountOnSalesHeader subscribes to Codeunit "Sales-Calc. Discount" OnAfterCalcSalesDiscount

## Procedures

- `PropagateOnInsert(var SalesOrderEntityBuffer: Record "Sales Order Entity Buffer"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateOnModify(var SalesOrderEntityBuffer: Record "Sales Order Entity Buffer"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateOnDelete(var SalesOrderEntityBuffer: Record "Sales Order Entity Buffer")`
- `UpdateBufferTableRecords()`
- `RedistributeInvoiceDiscounts(var SalesOrderEntityBuffer: Record "Sales Order Entity Buffer")`
- `LoadLines(var SalesInvoiceLineAggregate: Record "Sales Invoice Line Aggregate"; DocumentIdFilter: Text)`
- `PropagateInsertLine(var SalesInvoiceLineAggregate: Record "Sales Invoice Line Aggregate"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateModifyLine(var SalesInvoiceLineAggregate: Record "Sales Invoice Line Aggregate"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateDeleteLine(var SalesInvoiceLineAggregate: Record "Sales Invoice Line Aggregate")`
- `DeleteOrphanedRecords()`

Plus 18 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 5465 "Graph Mgt - General Tools"](../codeunit/5465.md) (9 calls: `CheckValidLineRecord → IsApiEnabled`, `OnAfterCalculateSalesDiscountOnSalesHeader → IsApiEnabled`, `OnAfterDeleteSalesHeader → IsApiEnabled`, …)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (3 calls: `PropagateOnInsert → TransferFieldsWithValidate`, `PropagateOnModify → TransferFieldsWithValidate`, `TransferSalesInvoiceLineAggregateToSalesLine → TransferFieldsWithValidate`)
- [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) (3 calls: `TransferFromSalesLine → GetIdFromDocumentIdAndSequence`, `TransferFromSalesLine → SetItemVariantId`, `TransferFromSalesLine → SetTaxGroupIdAndCode`)
- [Codeunit 9999 "Upgrade Tag"](../codeunit/9999.md) (2 calls: `DeleteOrphanedRecords → HasUpgradeTag`, `DeleteOrphanedRecords → SetUpgradeTag`)
- [Codeunit 5532 "Disable Aggregate Table Update"](../codeunit/5532.md) (1 call: `CheckUpdatesDisabled → OnGetAggregateTablesUpdateEnabled`)
- [Codeunit 56 "Sales - Calc Discount By Type"](../codeunit/56.md) (1 call: `RedistributeInvoiceDiscounts → (object)`)
- [Codeunit 57 "Document Totals"](../codeunit/57.md) (1 call: `AssignTotalsFromSalesLine → CalculateSalesTotals`)
- [Codeunit 9994 "API Data Upgrade"](../codeunit/9994.md) (1 call: `UpdateBufferTableRecords → CountRecordsAndCommit`)
- [Codeunit 9998 "Upgrade Tag Definitions"](../codeunit/9998.md) (1 call: `DeleteOrphanedRecords → GetDeleteSalesOrdersOrphanedRecords`)

## Called by

- [Page 20028 "APIV1 - Sales Orders"](../page/20028.md) (6 calls: `OnAfterGetRecord → RedistributeInvoiceDiscounts`, `OnDeleteRecord → PropagateOnDelete`, `OnInsertRecord → PropagateOnInsert`, …)
- [Page 30028 "APIV2 - Sales Orders"](../page/30028.md) (6 calls: `OnAfterGetRecord → RedistributeInvoiceDiscounts`, `OnDeleteRecord → PropagateOnDelete`, `OnInsertRecord → PropagateOnInsert`, …)
- [Page 20044 "APIV1 - Sales Order Lines"](../page/20044.md) (4 calls: `OnDeleteRecord → PropagateDeleteLine`, `OnFindRecord → LoadLines`, `OnInsertRecord → PropagateInsertLine`, …)
- [Page 30044 "APIV2 - Sales Order Lines"](../page/30044.md) (4 calls: `OnDeleteRecord → PropagateDeleteLine`, `OnFindRecord → LoadLines`, `OnInsertRecord → PropagateInsertLine`, …)
- [Codeunit 9994 "API Data Upgrade"](../codeunit/9994.md) (2 calls: `OnRun → DeleteOrphanedRecords`, `OnRun → UpdateBufferTableRecords`)
- [Codeunit 104000 "Upgrade - BaseApp"](../codeunit/104000.md) (1 call: `UpgradeInvoicesCreatedFromOrders → DeleteOrphanedRecords`)
- [Codeunit 5495 "Graph Mgt - Sales Order"](../codeunit/5495.md) (1 call: `HandleApiSetup → UpdateBufferTableRecords`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC28

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: "Graph Mgt - Sales Order Buffer")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
