---
title: "Codeunit 2678 Sales Alloc. Acc. Mgt., extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/points/
object: https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/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 2678 Sales Alloc. Acc. Mgt., extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/points/

24 procedures and triggers with a step in src/Layers/W1/BaseApp/Finance/AllocationAccount/Sales/SalesAllocAccMgt.Codeunit.al, in source order, read from the text, not from a run.

## GetOrGenerateAllocationLines

[Line 29](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L29), internal.

- [40](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L40) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetSalesHeader`
- [43](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L43) calls `LoadManualAllocationLines`
- [45](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L45) calls `GetAllocationAccount`
- [46](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L46) calls [Codeunit 2675 Allocation Account Mgt.](https://jonas-paprotka.de/ref/codeunit/2675-allocation-account-mgt/) `GenerateAllocationLines`
- [47](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L47) calls [Codeunit 2675 Allocation Account Mgt.](https://jonas-paprotka.de/ref/codeunit/2675-allocation-account-mgt/) `SplitQuantitiesIfNeeded`
- [48](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L48) calls `ReplaceInheritFromParent`

## LoadManualAllocationLines

[Line 52](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L52), internal.

- [72](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L72) raises `OnLoadManualAllocationLinesOnBeforeInsertAllocationLine`
- [73](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L73) writes [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) Insert

## ReplaceInheritFromParent

[Line 77](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L77), local.

- [93](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L93) writes [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) ModifyAll
- [97](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L97) writes [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) ModifyAll

## HandlePostDocument

[Line 107](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L107), local.

- [112](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L112) calls `VerifyLinesFromDocument`
- [116](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L116) calls [Codeunit 2676 Alloc. Acc. Telemetry](https://jonas-paprotka.de/ref/codeunit/2676-alloc-acc-telemetry/) `LogSalesInvoicePostingUsage`
- [117](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L117) calls `CreateLinesFromDocument`

## HandleAfterCheckSalesApprovalPossible

[Line 135](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L135), local.

- [139](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L139) calls `VerifyLinesFromDocument`
- [149](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L149) calls `CreateLinesFromDocument`

## CheckBeforeModifyLine

[Line 155](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L155), local.

- [157](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L157) calls `VerifySalesLine`
- [158](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L158) calls `DeleteManualDistributionsIfLineChanged`

## HandleValidateLineNo

[Line 162](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L162), local.

- [174](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L174) calls `VerifySalesLine`

## DeleteManualDistributionsIfLineChanged

[Line 182](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L182), local.

- [191](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L191) calls `AllocationAccountUsed`
- [215](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L215) writes [Table 2673 Alloc. Acc. Manual Override](https://jonas-paprotka.de/ref/table/2673-alloc-acc-manual-override/) DeleteAll

## CreateLinesFromDocument

[Line 223](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L223), local.

- [230](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L230) calls `CreateLines`
- [231](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L231) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) DeleteAll
- [237](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L237) calls `CreateLines`
- [238](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L238) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) DeleteAll

## CreateLines

[Line 241](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L241), local.

- [251](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L251) calls `CreateLinesFromAllocationAccountLine`

## CreateLinesFromAllocationAccountLine

[Line 260](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L260).

- [271](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L271) calls `GetAllocationAccount`
- [274](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L274) calls `VerifyAllocationAccount`
- [276](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L276) calls `GetOrGenerateAllocationLines`
- [284](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L284) calls `GetNextLine`
- [287](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L287) calls `GetLineIncrement`
- [290](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L290) calls `GetLastLine`
- [302](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L302) calls `GetDescriptionChanged`
- [305](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L305) calls `CreateSalesLine`
- [308](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L308) calls `FixQuantityRounding`
- [309](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L309) calls `DeleteManualOverrides`

## DeleteManualOverrides

[Line 312](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L312), local.

- [320](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L320) writes [Table 2673 Alloc. Acc. Manual Override](https://jonas-paprotka.de/ref/table/2673-alloc-acc-manual-override/) DeleteAll

## VerifyLinesFromDocument

[Line 323](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L323), local.

- [334](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L334) calls `VerifySalesLines`
- [346](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L346) calls `VerifySalesLines`

## CreateSalesLine

[Line 351](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L351), local.

- [360](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L360) calls [Codeunit 2674 Alloc. Acc. Handle Doc. Post](https://jonas-paprotka.de/ref/codeunit/2674-alloc-acc-handle-doc-post/) `SetVATBusPostingGroupCode`
- [363](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L363) calls [Codeunit 2674 Alloc. Acc. Handle Doc. Post](https://jonas-paprotka.de/ref/codeunit/2674-alloc-acc-handle-doc-post/) `SetVATProdPostingGroupCode`
- [366](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L366) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `No.`
- [376](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L376) calls `MoveAmounts`
- [377](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L377) calls `MoveQuantities`
- [380](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L380) calls `CopyDeferralSchedule`
- [381](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L381) calls `TransferDimensionSetID`
- [385](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L385) raises `OnBeforeCreateSalesLine`
- [387](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L387) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Insert(true)
- [390](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L390) calls `RedistributeQuantitiesIfNeededMoveQuantities`

## CopyDeferralSchedule

[Line 394](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L394), local.

- [412](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L412) calls [Codeunit 1720 Deferral Utilities](https://jonas-paprotka.de/ref/codeunit/1720-deferral-utilities/) `CreateCopyOfDeferralSchedule`

## RedistributeQuantitiesIfNeededMoveQuantities

[Line 430](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L430), local.

- [440](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L440) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [443](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L443) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Quantity`
- [444](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L444) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [445](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L445) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [446](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L446) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [447](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L447) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [448](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L448) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [449](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L449) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [450](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L450) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [451](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L451) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [452](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L452) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [453](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L453) calls [Table 2672 Allocation Line](https://jonas-paprotka.de/ref/table/2672-allocation-line/) `GetQuantityPrecision`
- [454](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L454) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Modify

## FixQuantityRounding

[Line 457](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L457), local.

- [532](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L532) writes [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) Modify

## MoveAmounts

[Line 535](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L535), local.

- [540](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L540) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit Price`
- [540](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L540) calls `GetUnitPrice`
- [541](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L541) calls `GetAmount`
- [544](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L544) validates [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `Unit Price`

## GetUnitPrice

[Line 549](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L549), local.

- [554](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L554) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetSalesHeader`
- [557](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L557) calls [Codeunit 2675 Allocation Account Mgt.](https://jonas-paprotka.de/ref/codeunit/2675-allocation-account-mgt/) `GetCurrencyUnitAmountPrecision`

## GetAmount

[Line 561](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L561), local.

- [567](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L567) calls [Table 37 Sales Line](https://jonas-paprotka.de/ref/table/37-sales-line/) `GetSalesHeader`
- [570](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L570) calls [Codeunit 2675 Allocation Account Mgt.](https://jonas-paprotka.de/ref/codeunit/2675-allocation-account-mgt/) `GetCurrencyRoundingPrecision`

## TransferDimensionSetID

[Line 647](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L647), local.

- [660](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L660) calls [Codeunit 408 DimensionManagement](https://jonas-paprotka.de/ref/codeunit/408-dimensionmanagement/) `UpdateGlobalDimFromDimSetID`
- [669](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L669) calls [Codeunit 408 DimensionManagement](https://jonas-paprotka.de/ref/codeunit/408-dimensionmanagement/) `GetCombinedDimensionSetID`

## VerifySalesLines

[Line 673](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L673), local.

- [680](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L680) calls `VerifySalesLine`

## VerifySelectedAllocationAccountNo

[Line 689](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L689).

- [700](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L700) calls `VerifyAllocationAccount`

## VerifySalesLine

[Line 731](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L731), local.

- [736](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L736) calls `AllocationAccountUsed`
- [739](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L739) raises `OnBeforeVerifySalesLine`
- [741](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L741) calls `VerifySelectedAllocationAccountNo`
- [747](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L747) calls `VerifyAllocationAccount`
- [748](https://jonas-paprotka.de/ref/codeunit/2678-sales-alloc-acc-mgt/source/#L748) calls [Codeunit 2675 Allocation Account Mgt.](https://jonas-paprotka.de/ref/codeunit/2675-allocation-account-mgt/) `VerifyNoInheritFromParentUsed`

## Source

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

JOP-AL, 2026-11-20.
