---
id: object/codeunit/5497
type: object
title: Codeunit 5497 "Graph Mgt - Purch Order Buffer"
summary: Codeunit 5497 "Graph Mgt - Purch Order Buffer" in Base Application (Microsoft.Integration.Graph). 11 public procedures, 8 event subscribers. Present since at least BC23, still in BC30, changed in BC25, 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: ea943007b8e0121cbd3d851d38caa86cb250cc3dd8b60363428c7a104dd3a825
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Integration/Graph/GraphMgtPurchOrderBuffer.Codeunit.al
    title: src/Layers/W1/BaseApp/Integration/Graph/GraphMgtPurchOrderBuffer.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: 5497
name: Graph Mgt - Purch 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:
  - "25"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 37
  events: 0
  subscribers: 8
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 10
  called_by: 5
  implements: 0
---

# Codeunit 5497 "Graph Mgt - Purch Order Buffer"

> Codeunit 5497 "Graph Mgt - Purch Order Buffer" in Base Application (Microsoft.Integration.Graph). 11 public procedures, 8 event subscribers. Present since at least BC23, still in BC30, changed in BC25, BC28.

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

## Properties

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

## Event subscriptions

- OnAfterInsertPurchaseHeader subscribes to Table "Purchase Header" OnAfterInsertEvent
- OnAfterModifyPurchaseHeader subscribes to Table "Purchase Header" OnAfterModifyEvent
- OnAfterDeletePurchaseHeader subscribes to Table "Purchase Header" OnAfterDeleteEvent
- OnAfterResetRecalculateInvoiceDisc subscribes to Codeunit "Purch - Calc Disc. By Type" OnAfterResetRecalculateInvoiceDisc
- OnAfterInsertPurchaseLine subscribes to Table "Purchase Line" OnAfterInsertEvent
- OnAfterModifyPurchaseLine subscribes to Table "Purchase Line" OnAfterModifyEvent
- OnAfterDeletePurchaseLine subscribes to Table "Purchase Line" OnAfterDeleteEvent
- OnAfterCalculatePurchaseDiscountOnPurchaseHeader subscribes to Codeunit "Purch.-Calc.Discount" OnAfterCalcPurchaseDiscount

## Procedures

- `PropagateOnInsert(var PurchaseOrderEntityBuffer: Record "Purchase Order Entity Buffer"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateOnModify(var PurchaseOrderEntityBuffer: Record "Purchase Order Entity Buffer"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateOnDelete(var PurchaseOrderEntityBuffer: Record "Purchase Order Entity Buffer")`
- `UpdateBufferTableRecords()`
- `InsertOrModifyFromPurchaseHeader(var PurchaseHeader: Record "Purchase Header")`
- `RedistributeInvoiceDiscounts(var PurchaseOrderEntityBuffer: Record "Purchase Order Entity Buffer")`
- `LoadLines(var PurchInvLineAggregate: Record "Purch. Inv. Line Aggregate"; DocumentIdFilter: Text)`
- `PropagateInsertLine(var PurchInvLineAggregate: Record "Purch. Inv. Line Aggregate"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateModifyLine(var PurchInvLineAggregate: Record "Purch. Inv. Line Aggregate"; var TempFieldBuffer: Record "Field Buffer" temporary)`
- `PropagateDeleteLine(var PurchInvLineAggregate: Record "Purch. Inv. 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`, `OnAfterCalculatePurchaseDiscountOnPurchaseHeader → IsApiEnabled`, `OnAfterDeletePurchaseHeader → IsApiEnabled`, …)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (3 calls: `PropagateOnInsert → TransferFieldsWithValidate`, `PropagateOnModify → TransferFieldsWithValidate`, `TransferPurchaseInvoiceLineAggregateToPurchaseLine → TransferFieldsWithValidate`)
- [Codeunit 9999 "Upgrade Tag"](../codeunit/9999.md) (2 calls: `DeleteOrphanedRecords → HasUpgradeTag`, `DeleteOrphanedRecords → SetUpgradeTag`)
- [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) (1 call: `TransferFromPurchaseLine → GetIdFromDocumentIdAndSequence`)
- [Codeunit 5529 "Purch. Inv. Aggregator"](../codeunit/5529.md) (1 call: `TransferFromPurchaseLine → SetTaxGroupIdAndCode`)
- [Codeunit 5532 "Disable Aggregate Table Update"](../codeunit/5532.md) (1 call: `CheckUpdatesDisabled → OnGetAggregateTablesUpdateEnabled`)
- [Codeunit 57 "Document Totals"](../codeunit/57.md) (1 call: `AssignTotalsFromPurchaseLine → CalculatePurchaseTotals`)
- [Codeunit 66 "Purch - Calc Disc. By Type"](../codeunit/66.md) (1 call: `RedistributeInvoiceDiscounts → (object)`)
- [Codeunit 9994 "API Data Upgrade"](../codeunit/9994.md) (1 call: `UpdateBufferTableRecords → CountRecordsAndCommit`)
- [Codeunit 9998 "Upgrade Tag Definitions"](../codeunit/9998.md) (1 call: `DeleteOrphanedRecords → GetDeletePurchaseOrdersOrphanedRecords`)

## Called by

- [Page 30066 "APIV2 - Purchase Orders"](../page/30066.md) (6 calls: `OnAfterGetRecord → RedistributeInvoiceDiscounts`, `OnDeleteRecord → PropagateOnDelete`, `OnInsertRecord → PropagateOnInsert`, …)
- [Page 30067 "APIV2 - Purchase Order Lines"](../page/30067.md) (4 calls: `OnDeleteRecord → PropagateDeleteLine`, `OnFindRecord → LoadLines`, `OnInsertRecord → PropagateInsertLine`, …)
- [Codeunit 104000 "Upgrade - BaseApp"](../codeunit/104000.md) (2 calls: `UpgradeInvoicesCreatedFromOrders → DeleteOrphanedRecords`, `UpgradePurchaseOrderEntityBuffer → InsertOrModifyFromPurchaseHeader`)
- [Codeunit 9994 "API Data Upgrade"](../codeunit/9994.md) (2 calls: `OnRun → DeleteOrphanedRecords`, `OnRun → UpdateBufferTableRecords`)
- [Codeunit 5518 "API Fix Purchase Order"](../codeunit/5518.md) (1 call: `UpdateAPIPurchOrders → InsertOrModifyFromPurchaseHeader`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25, 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 - Purch Order Buffer")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
