---
id: object/codeunit/1372
type: object
title: Codeunit 1372 "Purchase Batch Post Mgt."
summary: Codeunit 1372 "Purchase Batch Post Mgt." in Base Application (Microsoft.Purchases.Posting). 7 public procedures, 6 events, 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: 91c670cc2fef892a67d168ea46d9e6b499a4978bb0a72f3c979a8458772e550a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Posting/PurchaseBatchPostMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/Posting/PurchaseBatchPostMgt.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: 1372
name: Purchase Batch Post Mgt.
namespace: Microsoft.Purchases.Posting
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: 32
  events: 6
  subscribers: 8
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 11
  called_by: 0
  implements: 0
---

# Codeunit 1372 "Purchase Batch Post Mgt."

> Codeunit 1372 "Purchase Batch Post Mgt." in Base Application (Microsoft.Purchases.Posting). 7 public procedures, 6 events, 8 event subscribers. Present since at least BC23, still in BC30, changed in BC25, BC28.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Purchase Header |
| Permissions | TableData "Batch Processing Parameter" = rimd, TableData "Batch Processing Session Map" = rimd |

## Events published

- `OnAfterPreparePurchaseHeader(var PurchaseHeader: Record "Purchase Header")` (integration)
- `OnAfterRunBatch(var PurchaseHeader: Record "Purchase Header"; var TempErrorMessage: Record "Error Message" temporary)` (integration)
- `OnBeforeRunBatch(var PurchaseHeader: Record "Purchase Header"; var ReplacePostingDate: Boolean; var PostingDate: Date; var ReplaceDocumentDate: Boolean; Receive: Boolean; Invoice: Boolean)` (integration)
- `OnRunBatchOnAfterAddParameters(var BatchProcessingMgt: Codeunit "Batch Processing Mgt.")` (integration)
- `OnGetICBatchFileName(var Result: Text)` (integration)
- `OnAfterReleasePurchaseHeader(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean)` (integration)

## Event subscriptions

- PreparePurchaseHeaderOnBeforeBatchProcessing subscribes to Codeunit "Batch Processing Mgt." OnBeforeBatchProcessing
- CheckPurchaseHeaderOnVerifyRecord subscribes to Codeunit "Batch Processing Mgt." OnVerifyRecord
- HandleOnCustomProcessing subscribes to Codeunit "Batch Processing Mgt." OnCustomProcessing
- OnIsPostWithJobQueueEnabledHandler subscribes to Codeunit "Batch Processing Mgt." OnIsPostWithJobQueueEnabled
- OnProcessBatchInBackgroundHandler subscribes to Codeunit "Batch Processing Mgt." OnProcessBatchInBackground
- OnBatchProcessOnBeforeResetBatchID subscribes to Codeunit "Batch Processing Mgt." OnBatchProcessOnBeforeResetBatchID
- OnBeforeUpdateAnalysisView subscribes to Codeunit "Update Analysis View" OnBeforeUpdateAll
- OnBeforeUpdateItemAnalysisView subscribes to Codeunit "Update Item Analysis View" OnBeforeUpdateAll

## Procedures

- `RunBatch(var PurchaseHeader: Record "Purchase Header"; ReplacePostingDate: Boolean; PostingDate: Date; ReplaceDocumentDate: Boolean; CalcInvoiceDiscount: Boolean; Receive: Boolean; Invoice: Boolean)`
- `RunWithUI(var PurchaseHeader: Record "Purchase Header"; TotalCount: Integer; Question: Text)`
- `GetBatchProcessor(var ResultBatchProcessingMgt: Codeunit "Batch Processing Mgt.")`
- `SetBatchProcessor(NewBatchProcessingMgt: Codeunit "Batch Processing Mgt.")`
- `Code(var PurchaseHeader: Record "Purchase Header")`
- `SetPostingCodeunitId(NewPostingCodeunitId: Integer)`
- `SetParameter(ParameterId: Enum "Batch Posting Parameter Type"; ParameterValue: Variant)`

Plus 11 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 38 "Purchase Header"](../table/38.md)

## 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 1380 "Batch Processing Mgt."](../codeunit/1380.md) (9 calls: `Code → BatchProcess`, `Code → SetProcessingCodeunit`, `PreparePurchaseHeader → GetBooleanParameter`, …)
- [Codeunit 28 "Error Message Management"](../codeunit/28.md) (4 calls: `PrepareBatch → LogError`, `RunWithUI → Activate`, `RunWithUI → GetLastErrorID`, …)
- [Codeunit 1535 "Approvals Mgmt."](../codeunit/1535.md) (1 call: `CheckApprovalWorkflow → IsPurchaseApprovalsWorkflowEnabled`)
- [Codeunit 29 "Error Message Handler"](../codeunit/29.md) (1 call: `RunWithUI → ShowErrors`)
- [Codeunit 410 "Update Analysis View"](../codeunit/410.md) (1 call: `OnRun → UpdateAll`)
- [Codeunit 415 "Release Purchase Document"](../codeunit/415.md) (1 call: `ReleasePurchaseHeader → (object)`)
- [Codeunit 431 "IC Outbox Export"](../codeunit/431.md) (1 call: `OnBatchProcessOnBeforeResetBatchID → DownloadBatchFiles`)
- [Codeunit 70 "Purch.-Calc.Discount"](../codeunit/70.md) (1 call: `CalculateInvoiceDiscount → (object)`)
- [Codeunit 7150 "Update Item Analysis View"](../codeunit/7150.md) (1 call: `OnRun → UpdateAll`)
- [Codeunit 95 "Purch Post Batch via Job Queue"](../codeunit/95.md) (1 call: `ProcessBatchInBackground → EnqueuePurchaseBatch`)
- [Codeunit 98 "Purchase Post via Job Queue"](../codeunit/98.md) (1 call: `HandleOnCustomProcessing → EnqueuePurchDocWithUI`)

## 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: "Purchase Batch Post Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
