---
title: "Codeunit 5529 Purch. Inv. Aggregator, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/points/
object: https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 5529 Purch. Inv. Aggregator, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/points/

54 procedures and triggers with a step in src/Layers/W1/BaseApp/Integration/Entity/PurchInvAggregator.Codeunit.al, in source order, read from the text, not from a run.

## OnAfterInsertPurchaseHeader

[Line 47](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L47), local.

- [49](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L49) calls `CheckValidRecord`
- [49](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L49) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [52](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L52) calls `CheckUpdatesDisabled`
- [55](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L55) calls `InsertOrModifyFromPurchaseHeader`

## OnAfterModifyPurchaseHeader

[Line 59](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L59), local.

- [61](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L61) calls `CheckValidRecord`
- [61](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L61) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [64](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L64) calls `IsBackgroundPosting`
- [67](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L67) calls `CheckUpdatesDisabled`
- [70](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L70) calls `InsertOrModifyFromPurchaseHeader`

## OnAfterDeletePurchaseHeader

[Line 74](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L74), local.

- [78](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L78) calls `CheckValidRecord`
- [78](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L78) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [81](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L81) calls `CheckUpdatesDisabled`
- [84](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L84) calls `TransferRecordIDs`
- [89](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L89) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete

## OnAfterResetRecalculateInvoiceDisc

[Line 93](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L93), local.

- [95](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L95) calls `CheckValidRecord`
- [95](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L95) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [98](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L98) calls `CheckUpdatesDisabled`
- [101](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L101) calls `InsertOrModifyFromPurchaseHeader`

## OnAfterInsertPurchaseLine

[Line 105](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L105), local.

- [107](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L107) calls `CheckValidLineRecord`
- [110](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L110) calls `CheckUpdatesDisabled`
- [113](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L113) calls `ModifyTotalsPurchaseLine`

## OnAfterModifyPurchaseLine

[Line 117](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L117), local.

- [119](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L119) calls `CheckValidLineRecord`
- [122](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L122) calls `CheckUpdatesDisabled`
- [125](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L125) calls `ModifyTotalsPurchaseLine`

## OnAfterDeletePurchaseLine

[Line 129](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L129), local.

- [136](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L136) calls `CheckUpdatesDisabled`
- [144](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L144) calls `ModifyTotalsPurchaseLine`
- [151](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L151) calls `BlankTotals`

## OnAfterInsertPurchaseInvoiceHeader

[Line 155](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L155), local.

- [157](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L157) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [160](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L160) calls `CheckUpdatesDisabled`
- [163](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L163) calls `InsertOrModifyFromPurchaseInvoiceHeader`

## OnAfterModifyPurchaseInvoiceHeader

[Line 167](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L167), local.

- [169](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L169) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [172](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L172) calls `CheckUpdatesDisabled`
- [175](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L175) calls `InsertOrModifyFromPurchaseInvoiceHeader`

## OnAfterRenamePurchaseInvoiceHeader

[Line 179](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L179), local.

- [183](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L183) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [186](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L186) calls `CheckUpdatesDisabled`
- [192](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L192) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `SetIsRenameAllowed`
- [193](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L193) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Rename

## OnAfterDeletePurchaseInvoiceHeader

[Line 197](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L197), local.

- [201](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L201) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [204](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L204) calls `CheckUpdatesDisabled`
- [210](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L210) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete

## OnAfterCalculatePurchaseDiscountOnPurchaseHeader

[Line 214](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L214), local.

- [216](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L216) calls `CheckValidRecord`
- [216](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L216) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [219](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L219) calls `CheckUpdatesDisabled`
- [222](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L222) calls `InsertOrModifyFromPurchaseHeader`

## OnAfterInsertVendorLedgerEntry

[Line 226](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L226), local.

- [228](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L228) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [231](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L231) calls `CheckUpdatesDisabled`
- [234](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L234) calls `SetStatusOptionFromVendLedgerEntry`

## OnAfterModifyVendorLedgerEntry

[Line 238](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L238), local.

- [240](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L240) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [243](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L243) calls `CheckUpdatesDisabled`
- [246](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L246) calls `SetStatusOptionFromVendLedgerEntry`

## OnAfterRenameVendorLedgerEntry

[Line 250](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L250), local.

- [252](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L252) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [255](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L255) calls `CheckUpdatesDisabled`
- [258](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L258) calls `SetStatusOptionFromVendLedgerEntry`

## OnAfterDeleteVendorLedgerEntry

[Line 262](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L262), local.

- [264](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L264) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [267](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L267) calls `CheckUpdatesDisabled`
- [270](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L270) calls `SetStatusOptionFromVendLedgerEntry`

## OnAfterInsertCancelledDocument

[Line 274](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L274), local.

- [276](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L276) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [279](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L279) calls `CheckUpdatesDisabled`
- [282](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L282) calls `SetStatusOptionFromCancelledDocument`

## OnAfterModifyCancelledDocument

[Line 286](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L286), local.

- [288](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L288) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [291](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L291) calls `CheckUpdatesDisabled`
- [294](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L294) calls `SetStatusOptionFromCancelledDocument`

## OnAfterRenameCancelledDocument

[Line 298](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L298), local.

- [300](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L300) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [303](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L303) calls `CheckUpdatesDisabled`
- [306](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L306) calls `SetStatusOptionFromCancelledDocument`
- [307](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L307) calls `SetStatusOptionFromCancelledDocument`

## OnAfterDeleteCancelledDocument

[Line 311](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L311), local.

- [313](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L313) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [316](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L316) calls `CheckUpdatesDisabled`
- [319](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L319) calls `SetStatusOptionFromCancelledDocument`

## OnBeforePurchInvHeaderInsert

[Line 323](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L323), local.

- [329](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L329) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [337](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L337) calls `CheckUpdatesDisabled`
- [353](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L353) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete
- [356](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L356) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `GetIsRenameAllowed`
- [357](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L357) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `SetIsRenameAllowed`
- [358](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L358) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Rename
- [359](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L359) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `SetIsRenameAllowed`

## PropagateOnInsert

[Line 363](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L363).

- [370](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L370) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [383](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L383) calls `TransferFieldsWithValidate`
- [400](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L400) calls `TransferFieldsWithValidate`

## PropagateOnModify

[Line 408](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L408).

- [414](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L414) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [426](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L426) calls `TransferFieldsWithValidate`
- [436](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L436) calls `TransferFieldsWithValidate`

## PropagateOnDelete

[Line 442](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L442).

- [447](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L447) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [454](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L454) writes [Table 122 Purch. Inv. Header](https://jonas-paprotka.de/ref/table/122-purch-inv-header/) Delete(true)
- [457](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L457) writes [Table 38 Purchase Header](https://jonas-paprotka.de/ref/table/38-purchase-header/) Delete(true)

## UpdateAggregateTableRecords

[Line 461](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L461).

- [472](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L472) calls `InsertOrModifyFromPurchaseHeader`
- [473](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L473) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [478](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L478) calls `InsertOrModifyFromPurchaseInvoiceHeader`
- [479](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L479) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [486](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L486) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete(true)
- [487](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L487) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`
- [495](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L495) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete(true)
- [496](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L496) calls [Codeunit 9994 API Data Upgrade](https://jonas-paprotka.de/ref/codeunit/9994-api-data-upgrade/) `CountRecordsAndCommit`

## InsertOrModifyFromPurchaseHeader

[Line 501](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L501), local.

- [513](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L513) calls `AssignTotalsFromPurchaseHeader`
- [514](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L514) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `UpdateReferencedRecordIds`
- [517](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L517) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Modify(true)
- [519](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L519) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Insert(true)

## InsertOrModifyFromPurchaseInvoiceHeader

[Line 541](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L541), local.

- [549](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L549) calls `GetPurchaseInvoiceHeaderId`
- [552](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L552) calls `SetStatusOptionFromPurchaseInvoiceHeader`
- [553](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L553) calls `AssignTotalsFromPurchaseInvoiceHeader`
- [554](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L554) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `UpdateReferencedRecordIds`
- [557](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L557) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Modify(true)
- [559](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L559) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Insert(true)

## SetStatusOptionFromVendLedgerEntry

[Line 583](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L583), local.

- [587](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L587) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [598](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L598) calls `UpdateStatusIfChanged`

## SetStatusOptionFromCancelledDocument

[Line 602](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L602), local.

- [606](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L606) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [620](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L620) calls `UpdateStatusIfChanged`

## UpdateUnitOfMeasure

[Line 623](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L623).

- [629](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L629) calls [Codeunit 5470 Graph Collection Mgt - Item](https://jonas-paprotka.de/ref/codeunit/5470-graph-collection-mgt-item/) `UpdateOrCreateItemUnitOfMeasureFromSalesDocument`
- [632](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L632) writes [Table 27 Item](https://jonas-paprotka.de/ref/table/27-item/) Modify(true)

## UpdateStatusIfChanged

[Line 635](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L635), local.

- [643](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L643) calls `CheckUpdatesDisabled`
- [648](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L648) calls `SetStatusOptionFromPurchaseInvoiceHeader`
- [650](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L650) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Modify(true)

## AssignTotalsFromPurchaseHeader

[Line 653](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L653), local.

- [661](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L661) calls `BlankTotals`
- [665](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L665) calls `AssignTotalsFromPurchaseLine`

## AssignTotalsFromPurchaseInvoiceHeader

[Line 668](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L668), local.

- [675](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L675) calls `BlankTotals`
- [679](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L679) calls `AssignTotalsFromPurchaseInvoiceLine`

## AssignTotalsFromPurchaseLine

[Line 682](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L682), local.

- [694](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L694) calls [Codeunit 57 Document Totals](https://jonas-paprotka.de/ref/codeunit/57-document-totals/) `CalculatePurchaseTotals`

## AssignTotalsFromPurchaseInvoiceLine

[Line 702](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L702), local.

- [716](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L716) calls [Codeunit 57 Document Totals](https://jonas-paprotka.de/ref/codeunit/57-document-totals/) `CalculatePostedPurchInvoiceTotals`

## BlankTotals

[Line 724](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L724), local.

- [731](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L731) calls `CheckUpdatesDisabled`
- [739](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L739) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Modify

## ModifyTotalsPurchaseLine

[Line 753](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L753), local.

- [758](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L758) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`
- [767](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L767) calls `CheckUpdatesDisabled`
- [776](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L776) calls `AssignTotalsFromPurchaseLine`
- [777](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L777) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Modify(true)

## TransferPurchaseInvoiceLineAggregateToPurchaseLine

[Line 780](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L780), local.

- [787](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L787) calls `TransferFieldsWithValidate`

## TransferRecordIDs

[Line 792](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L792), local.

- [809](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L809) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Delete(true)
- [812](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L812) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `GetIsRenameAllowed`
- [813](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L813) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `SetIsRenameAllowed`
- [814](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L814) writes [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) Rename
- [815](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L815) calls [Table 5477 Purch. Inv. Entity Aggregate](https://jonas-paprotka.de/ref/table/5477-purch-inv-entity-aggregate/) `SetIsRenameAllowed`
- [819](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L819) writes [Table 122 Purch. Inv. Header](https://jonas-paprotka.de/ref/table/122-purch-inv-header/) Modify(true)

## TransferFieldsWithValidate

[Line 822](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L822), local.

- [829](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L829) calls [Codeunit 701 Data Type Management](https://jonas-paprotka.de/ref/codeunit/701-data-type-management/) `GetRecordRef`

## RedistributeInvoiceDiscounts

[Line 846](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L846).

- [857](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L857) runs [Codeunit 66 Purch - Calc Disc. By Type](https://jonas-paprotka.de/ref/codeunit/66-purch-calc-disc-by-type/)

## LoadLines

[Line 862](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L862).

- [874](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L874) calls `LoadPurchaseInvoiceLines`
- [876](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L876) calls `LoadPurchaseLines`

## LoadPurchaseInvoiceLines

[Line 879](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L879), local.

- [891](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L891) calls [Codeunit 5477 Sales Invoice Aggregator](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/) `GetIdFromDocumentIdAndSequence`
- [901](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L901) calls [Table 123 Purch. Inv. Line](https://jonas-paprotka.de/ref/table/123-purch-inv-line/) `GetCurrencyCode`
- [903](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L903) calls [Table 5478 Purch. Inv. Line Aggregate](https://jonas-paprotka.de/ref/table/5478-purch-inv-line-aggregate/) `UpdateReferencedRecordIds`
- [904](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L904) calls `UpdateLineAmountsFromPurchaseInvoiceLine`
- [905](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L905) calls `SetItemVariantId`
- [906](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L906) writes [Table 5478 Purch. Inv. Line Aggregate](https://jonas-paprotka.de/ref/table/5478-purch-inv-line-aggregate/) Insert(true)

## LoadPurchaseLines

[Line 910](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L910), local.

- [919](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L919) calls `TransferFromPurchaseLine`
- [920](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L920) writes [Table 5478 Purch. Inv. Line Aggregate](https://jonas-paprotka.de/ref/table/5478-purch-inv-line-aggregate/) Insert(true)

## TransferFromPurchaseLine

[Line 924](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L924), local.

- [932](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L932) calls [Codeunit 5477 Sales Invoice Aggregator](https://jonas-paprotka.de/ref/codeunit/5477-sales-invoice-aggregator/) `GetIdFromDocumentIdAndSequence`
- [934](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L934) calls `SetTaxGroupIdAndCode`
- [942](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L942) calls [Table 5478 Purch. Inv. Line Aggregate](https://jonas-paprotka.de/ref/table/5478-purch-inv-line-aggregate/) `UpdateReferencedRecordIds`
- [943](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L943) calls `UpdateLineAmountsFromPurchaseLine`
- [944](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L944) calls `SetItemVariantId`

## PropagateInsertLine

[Line 947](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L947).

- [953](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L953) calls `VerifyCRUDIsPossibleForLine`
- [971](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L971) calls `TransferPurchaseInvoiceLineAggregateToPurchaseLine`
- [972](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L972) writes [Table 39 Purchase Line](https://jonas-paprotka.de/ref/table/39-purchase-line/) Insert(true)
- [974](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L974) calls `RedistributeInvoiceDiscounts`
- [977](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L977) calls `TransferFromPurchaseLine`

## PropagateModifyLine

[Line 980](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L980).

- [985](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L985) calls `VerifyCRUDIsPossibleForLine`
- [990](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L990) calls `TransferPurchaseInvoiceLineAggregateToPurchaseLine`
- [992](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L992) writes [Table 39 Purchase Line](https://jonas-paprotka.de/ref/table/39-purchase-line/) Modify(true)
- [994](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L994) calls `RedistributeInvoiceDiscounts`
- [997](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L997) calls `TransferFromPurchaseLine`

## PropagateDeleteLine

[Line 1000](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1000).

- [1005](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1005) calls `VerifyCRUDIsPossibleForLine`
- [1008](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1008) writes [Table 39 Purchase Line](https://jonas-paprotka.de/ref/table/39-purchase-line/) Delete(true)
- [1009](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1009) calls `RedistributeInvoiceDiscounts`

## UpdateLineAmountsFromPurchaseLine

[Line 1039](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1039).

- [1043](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1043) calls `UpdateInvoiceDiscountAmount`

## UpdateLineAmountsFromPurchaseInvoiceLine

[Line 1054](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1054), local.

- [1058](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1058) calls `UpdateInvoiceDiscountAmount`

## CheckValidLineRecord

[Line 1076](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1076), local.

- [1081](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1081) calls [Codeunit 5465 Graph Mgt - General Tools](https://jonas-paprotka.de/ref/codeunit/5465-graph-mgt-general-tools/) `IsApiEnabled`

## CheckUpdatesDisabled

[Line 1098](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1098), local.

- [1103](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1103) calls [Codeunit 5532 Disable Aggregate Table Update](https://jonas-paprotka.de/ref/codeunit/5532-disable-aggregate-table-update/) `OnGetAggregateTablesUpdateEnabled`

## FixInvoicesCreatedFromOrders

[Line 1111](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1111).

- [1120](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1120) writes [Table 122 Purch. Inv. Header](https://jonas-paprotka.de/ref/table/122-purch-inv-header/) ModifyAll
- [1122](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1122) calls [Codeunit 9999 Upgrade Tag](https://jonas-paprotka.de/ref/codeunit/9999-upgrade-tag/) `HasUpgradeTag`
- [1122](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1122) calls [Codeunit 9998 Upgrade Tag Definitions](https://jonas-paprotka.de/ref/codeunit/9998-upgrade-tag-definitions/) `GetFixAPIPurchaseInvoicesCreatedFromOrders`
- [1123](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1123) calls [Codeunit 9999 Upgrade Tag](https://jonas-paprotka.de/ref/codeunit/9999-upgrade-tag/) `SetUpgradeTag`
- [1123](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1123) calls [Codeunit 9998 Upgrade Tag Definitions](https://jonas-paprotka.de/ref/codeunit/9998-upgrade-tag-definitions/) `GetFixAPIPurchaseInvoicesCreatedFromOrders`

## SetTaxGroupIdAndCode

[Line 1126](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1126).

- [1133](https://jonas-paprotka.de/ref/codeunit/5529-purch-inv-aggregator/source/#L1133) calls [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) `UseVat`

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
