---
title: "Codeunit 1371 Sales Batch Post Mgt., extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/points/
object: https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-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 1371 Sales Batch Post Mgt., extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/points/

21 procedures and triggers with a step in src/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al, in source order, read from the text, not from a run.

## OnRun

[Line 27](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L27), trigger.

- [37](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L37) calls [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/) `SetPostingCodeunitId`
- [38](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L38) calls [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/) `SetBatchProcessor`
- [39](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L39) calls [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/) `Code`
- [43](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L43) calls [Codeunit 410 Update Analysis View](https://jonas-paprotka.de/ref/codeunit/410-update-analysis-view/) `UpdateAll`
- [44](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L44) calls [Codeunit 7150 Update Item Analysis View](https://jonas-paprotka.de/ref/codeunit/7150-update-item-analysis-view/) `UpdateAll`

## RunBatch

[Line 67](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L67).

- [73](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L73) raises `OnBeforeRunBatch`
- [78](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L78) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [79](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L79) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [80](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L80) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [81](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L81) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [82](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L82) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [83](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L83) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`
- [84](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L84) raises `OnRunBatchOnAfterAddParameters`
- [86](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L86) calls [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/) `SetBatchProcessor`
- [88](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L88) runs [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/)
- [89](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L89) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `ResetBatchID`
- [91](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L91) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetErrorMessages`
- [94](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L94) calls [Page 700 Error Messages](https://jonas-paprotka.de/ref/page/700-error-messages/) `SetRecords`

## RunWithUI

[Line 106](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L106).

- [115](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L115) raises `OnBeforeRunWithUI`, IsHandled
- [122](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L122) calls [Codeunit 28 Error Message Management](https://jonas-paprotka.de/ref/codeunit/28-error-message-management/) `Activate`
- [123](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L123) calls [Codeunit 28 Error Message Management](https://jonas-paprotka.de/ref/codeunit/28-error-message-management/) `PushContext`
- [124](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L124) calls [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/) `SetBatchProcessor`
- [126](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L126) runs [Codeunit 1371 Sales Batch Post Mgt.](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/)
- [127](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L127) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `ResetBatchID`
- [129](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L129) calls [Codeunit 28 Error Message Management](https://jonas-paprotka.de/ref/codeunit/28-error-message-management/) `GetLastErrorID`
- [130](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L130) calls [Codeunit 29 Error Message Handler](https://jonas-paprotka.de/ref/codeunit/29-error-message-handler/) `ShowErrors`

## Code

[Line 155](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L155).

- [164](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L164) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetProcessingCodeunit`
- [165](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L165) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `BatchProcess`

## GetICBatchFileName

[Line 170](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L170), local.

- [174](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L174) raises `OnGetICBatchFileName`

## PrepareSalesHeader

[Line 177](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L177), local.

- [184](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L184) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [185](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L185) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [186](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L186) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetDateParameter`
- [187](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L187) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [188](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L188) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetDateParameter`
- [189](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L189) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [192](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L192) calls `CalculateInvoiceDiscount`
- [194](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L194) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `BatchConfirmUpdateDeferralDate`
- [195](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L195) calls `PerformManualReleaseOrReopenSalesHeader`
- [196](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L196) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `BatchConfirmUpdatePostingDate`
- [197](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L197) calls `PerformManualReleaseOrReopenSalesHeader`
- [198](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L198) raises `OnPrepareSalesHeaderOnAfterBatchConfirmUpdateDeferralDate`
- [200](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L200) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [201](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L201) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [202](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L202) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [203](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L203) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `GetBooleanParameter`
- [205](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L205) raises `OnAfterPrepareSalesHeader`

## CalculateInvoiceDiscount

[Line 217](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L217), local.

- [225](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L225) runs [Codeunit 60 Sales-Calc. Discount](https://jonas-paprotka.de/ref/codeunit/60-sales-calc-discount/)

## CanPostDocument

[Line 231](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L231), local.

- [233](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L233) calls `CheckApprovalWorkflow`
- [236](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L236) calls [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) `IsApprovedForPostingBatch`
- [240](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L240) raises `OnAfterCanPostDocument`

## CheckApprovalWorkflow

[Line 244](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L244), local.

- [248](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L248) calls [Codeunit 1535 Approvals Mgmt.](https://jonas-paprotka.de/ref/codeunit/1535-approvals-mgmt/) `IsSalesApprovalsWorkflowEnabled`

## SetParameter

[Line 260](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L260).

- [264](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L264) calls `GetBatchProcessor`
- [265](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L265) calls [Codeunit 1380 Batch Processing Mgt.](https://jonas-paprotka.de/ref/codeunit/1380-batch-processing-mgt/) `SetParameter`

## ProcessBatchInBackground

[Line 268](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L268), local.

- [273](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L273) calls `PrepareBatch`
- [274](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L274) calls [Codeunit 85 Sales Post Batch via Job Queue](https://jonas-paprotka.de/ref/codeunit/85-sales-post-batch-via-job-queue/) `EnqueueSalesBatch`

## PrepareBatch

[Line 277](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L277), local.

- [296](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L296) calls `CanProcessSalesHeader`
- [297](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L297) calls `PrepareSalesHeader`
- [298](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L298) calls `PrepareJobQueueEntry`
- [301](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L301) writes [Table 36 Sales Header](https://jonas-paprotka.de/ref/table/36-sales-header/) Modify
- [306](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L306) calls [Codeunit 28 Error Message Management](https://jonas-paprotka.de/ref/codeunit/28-error-message-management/) `LogError`

## CanProcessSalesHeader

[Line 317](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L317), local.

- [319](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L319) calls `CheckSalesHeaderJobQueueStatus`
- [322](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L322) calls `CanPostDocument`
- [325](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L325) calls `ReleaseSalesHeader`

## ReleaseSalesHeader

[Line 338](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L338), local.

- [343](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L343) raises `OnBeforeReleaseSalesHeader`, IsHandled
- [348](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L348) runs [Codeunit 414 Release Sales Document](https://jonas-paprotka.de/ref/codeunit/414-release-sales-document/)

## PrepareJobQueueEntry

[Line 353](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L353), local.

- [360](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L360) writes [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) Insert(true)

## PerformManualReleaseOrReopenSalesHeader

[Line 363](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L363), local.

- [375](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L375) calls `ReleaseSalesHeader`
- [378](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L378) calls [Codeunit 414 Release Sales Document](https://jonas-paprotka.de/ref/codeunit/414-release-sales-document/) `PerformManualReopen`

## PrepareSalesHeaderOnBeforeBatchProcessing

[Line 384](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L384), local.

- [389](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L389) calls `PrepareSalesHeader`

## CheckSalesHeaderOnVerifyRecord

[Line 394](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L394), local.

- [399](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L399) calls `CanPostDocument`

## HandleOnCustomProcessing

[Line 404](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L404), local.

- [416](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L416) calls [Codeunit 88 Sales Post via Job Queue](https://jonas-paprotka.de/ref/codeunit/88-sales-post-via-job-queue/) `EnqueueSalesDocWithUI`
- [426](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L426) raises `OnAfterHandleOnCustomProcessing`

## OnProcessBatchInBackgroundHandler

[Line 540](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L540), local.

- [545](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L545) calls `ProcessBatchInBackground`

## OnBatchProcessOnBeforeResetBatchID

[Line 550](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L550), local.

- [554](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L554) calls [Codeunit 431 IC Outbox Export](https://jonas-paprotka.de/ref/codeunit/431-ic-outbox-export/) `DownloadBatchFiles`
- [554](https://jonas-paprotka.de/ref/codeunit/1371-sales-batch-post-mgt/source/#L554) calls `GetICBatchFileName`

## Source

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

JOP-AL, 2026-11-20.
