---
id: object/codeunit/99
type: object
title: Codeunit 99 "Posting Selection Management"
summary: Codeunit 99 "Posting Selection Management" in Base Application (Microsoft.Finance.ReceivablesPayables). 13 public procedures, 8 events. Present since at least BC23, still in BC30, changed in BC24-26, 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: 86ab4ef94189fb77f932db522aee126d81ce900195e8a52f5722ab1f4cdf9848
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/PostingSelectionManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/ReceivablesPayables/PostingSelectionManagement.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: 99
name: Posting Selection Management
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 27
  events: 8
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 1
  calls: 2
  called_by: 10
  implements: 0
---

# Codeunit 99 "Posting Selection Management"

> Codeunit 99 "Posting Selection Management" in Base Application (Microsoft.Finance.ReceivablesPayables). 13 public procedures, 8 events. Present since at least BC23, still in BC30, changed in BC24-26, BC28.

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

## Events published

- `OnConfirmPostSalesDocumentOnBeforeSalesOrderGetSalesInvoicePostingPolicy(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration): Integration event raised before getting sales invoice posting policy for sales orders.
- `OnConfirmPostSalesDocumentOnBeforeSalesOrderReturnGetSalesInvoicePostingPolicy(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration): Integration event raised before getting sales invoice posting policy for sales return orders.
- `OnConfirmPostPurchaseDocumentOnBeforePurchaseOrderGetPurchaseInvoicePostingPolicy(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration): Integration event raised before getting purchase invoice posting policy for purchase orders.
- `OnConfirmPostPurchaseDocumentOnBeforePurchaseReturnOrderGetPurchaseInvoicePostingPolicy(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration): Integration event raised before getting purchase invoice posting policy for purchase return orders.
- `OnBeforeGetShipInvoiceSelectionForWhseActivity(var DefaultOption: Integer; var Selection: Integer; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before getting ship/invoice selection for warehouse activities.
- `OnAfterGetInvoicePostingPolicy(SourceDocument: Enum "Warehouse Activity Source Document"; var Ship: Boolean; var Invoice: Boolean)` (integration): Integration event raised after determining invoice posting policy for warehouse activities. Enables customization of posting policy decisions based on warehouse source documents.
  - subscribers: [Codeunit 5995 "Service Warehouse Mgt."](../codeunit/5995.md) OnAfterGetInvoicePostingPolicy
- `OnBeforeGetSalesOrderPostingSelection(var SalesHeader: Record "Sales Header"; DefaultOption: Integer; var IsHandled: Boolean; var Selection: Integer)` (integration): Integration event raised before determining sales order posting selection. Enables custom logic for posting option selection and validation.
- `OnBeforeGetPurchaseOrderPostingSelection(var PurchaseHeader: Record "Purchase Header"; DefaultOption: Integer; var IsHandled: Boolean; var Selection: Integer)` (integration): Integration event raised before determining purchase order posting selection. Enables custom logic for posting option selection and validation.

## Procedures

- `ConfirmPostSalesDocument(var SalesHeaderToPost: Record "Sales Header"; DefaultOption: Integer; WithPrint: Boolean; WithEmail: Boolean): Boolean`: Displays confirmation dialog for sales document posting with user selection options.
- `ConfirmPostPurchaseDocument(var PurchaseHeaderToPost: Record "Purchase Header"; DefaultOption: Integer; WithPrint: Boolean; WithEmail: Boolean): Boolean`: Displays confirmation dialog for purchase document posting with user selection options.
- `ConfirmPostWarehouseActivity(var WarehouseActivityLine: Record "Warehouse Activity Line"; var Selection: Integer; DefaultOption: Integer; WithPrint: Boolean): Boolean`: Displays confirmation dialog for warehouse activity posting with user selection options.
- `ConfirmPostWhseShipment(var WarehouseShipmentLine: Record "Warehouse Shipment Line"; var Selection: Integer): Boolean`: Displays confirmation dialog for warehouse shipment posting with user selection options.
- `CheckUserCanInvoiceSales()`: Verifies that the current user has permission to invoice sales documents.
- `CheckUserCanInvoicePurchase()`: Verifies that the current user has permission to invoice purchase documents.
- `IsPostingInvoiceMandatoryPurchase(): Boolean` (internal)
- `GetPostConfirmationMessage(What: Text; WithPrint: Boolean; WithEmail: Boolean): Text`: Returns confirmation message text for posting operations with print and email options.
- `GetPostConfirmationMessage(IsInvoice: Boolean; WithPrint: Boolean; WithEmail: Boolean): Text`: Returns confirmation message text for invoice posting operations with print and email options.
- `GetShipConfirmationMessage(): Text`: Returns confirmation message text for shipping operations.
- `GetShipInvoiceConfirmationMessage(): Text`: Returns confirmation message text for ship and invoice operations.
- `GetReceiveConfirmationMessage(): Text`: Returns confirmation message text for receiving operations.
- `GetPostingInvoiceProhibitedErr(): Text`: Returns error message text for prohibited invoice posting.

Plus 6 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 5700 "User Setup Management"](../codeunit/5700.md) (7 calls: `CheckUserCanInvoicePurchase → GetPurchaseInvoicePostingPolicy`, `CheckUserCanInvoiceSales → GetSalesInvoicePostingPolicy`, `ConfirmPostPurchaseDocument → GetPurchaseInvoicePostingPolicy`, …)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (5 calls: `ConfirmPostPurchaseDocument → GetResponseOrDefault`, `ConfirmPostSalesDocument → GetResponseOrDefault`, `ConfirmPostWarehouseActivity → GetResponseOrDefault`, …)

## Called by

- [Codeunit 5957 "Serv. Posting Selection Mgt."](../codeunit/5957.md) (4 calls: `CheckUserCanInvoiceService → GetPostingInvoiceProhibitedErr`, `ConfirmPostServiceDocument → GetPostConfirmationMessage`, `ConfirmPostServiceDocument → GetShipConfirmationMessage`, …)
- [Codeunit 91 "Purch.-Post (Yes/No)"](../codeunit/91.md) (3 calls: `ConfirmPost → ConfirmPostPurchaseDocument`, `SelectPostOrderOption → ConfirmPostPurchaseDocument`, `SelectPostReturnOrderOption → ConfirmPostPurchaseDocument`)
- [Codeunit 92 "Purch.-Post + Print"](../codeunit/92.md) (3 calls: `ConfirmPost → ConfirmPostPurchaseDocument`, `SelectPostOrderOption → ConfirmPostPurchaseDocument`, `SelectPostReturnOrderOption → ConfirmPostPurchaseDocument`)
- [Codeunit 7323 "Whse.-Act.-Post (Yes/No)"](../codeunit/7323.md) (2 calls: `SelectForOtherTypes → ConfirmPostWarehouseActivity`, `SelectForPutAway → ConfirmPostWarehouseActivity`)
- [Codeunit 5764 "Whse.-Post Shipment (Yes/No)"](../codeunit/5764.md) (1 call: `Code → ConfirmPostWhseShipment`)
- [Codeunit 5765 "Whse.-Post Shipment + Print"](../codeunit/5765.md) (1 call: `Code → ConfirmPostWhseShipment`)
- [Codeunit 79 "Sales-Post and Send"](../codeunit/79.md) (1 call: `Code → CheckUserCanInvoiceSales`)
- [Codeunit 81 "Sales-Post (Yes/No)"](../codeunit/81.md) (1 call: `ConfirmPost → ConfirmPostSalesDocument`)
- [Codeunit 82 "Sales-Post + Print"](../codeunit/82.md) (1 call: `ConfirmPost → ConfirmPostSalesDocument`)
- [Table 5766 "Warehouse Activity Header"](../table/5766.md) (1 call: `IsInvoiceNoMandatory → IsPostingInvoiceMandatoryPurchase`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-26, 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: "Posting Selection Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
