---
id: object/codeunit/81
type: object
title: Codeunit 81 "Sales-Post (Yes/No)"
summary: Codeunit 81 "Sales-Post (Yes/No)" in Base Application (Microsoft.Sales.Posting). 3 public procedures, 9 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-26.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "26"
  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: a3ca4d7f90292eb4294ff52eb78349027d4c5de044b24b694ba9ac7b1570ec57
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Posting/SalesPostYesNo.Codeunit.al
    title: src/Layers/W1/BaseApp/Sales/Posting/SalesPostYesNo.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/au
    - localization/nz
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 81
name: Sales-Post (Yes/No)
namespace: Microsoft.Sales.Posting
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"
source_major: "29"
obsolete: null
countries:
  - au
  - nz
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 16
  events: 9
  subscribers: 1
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 5
  called_by: 7
  implements: 0
---

# Codeunit 81 "Sales-Post (Yes/No)"

> Codeunit 81 "Sales-Post (Yes/No)" in Base Application (Microsoft.Sales.Posting). 3 public procedures, 9 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-26.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Sales Header |

## Events published

- `OnAfterPost(var SalesHeader: Record "Sales Header"; PostAndSend: Boolean)` (integration): Raised after the sales document has been posted.
- `OnAfterConfirmPost(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration): Raised after the user confirms posting the sales document.
- `OnRunPreviewOnAfterSetPostingFlags(var SalesHeader: Record "Sales Header")` (integration): Raised after the posting flags (Ship, Receive, Invoice) are set during posting preview.
- `OnBeforeConfirmPost(var SalesHeader: Record "Sales Header"; var DefaultOption: Integer; var Result: Boolean; var IsHandled: Boolean)` (integration): Raised before displaying the posting confirmation dialog.
- `OnBeforeConfirmSalesPost(var SalesHeader: Record "Sales Header"; var HideDialog: Boolean; var IsHandled: Boolean; var DefaultOption: Integer; var PostAndSend: Boolean)` (integration): Raised before confirming and posting the sales document.
- `OnBeforeOnRun(var SalesHeader: Record "Sales Header")` (integration): Raised before the OnRun trigger executes.
- `OnBeforeRunSalesPost(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var SuppressCommit: Boolean)` (integration): Raised before running the Sales-Post codeunit.
- `OnConfirmPostOnBeforeSetSelection(var SalesHeader: Record "Sales Header")` (integration): Raised before setting the posting selection options in the confirmation dialog.
- `OnBeforeRunPreview(var Result: Boolean; RecVar: Variant; var IsHandled: Boolean)` (integration): Raised before running the posting preview.

## Event subscriptions

- OnRunPreview subscribes to Codeunit "Gen. Jnl.-Post Preview" OnRunPreview

## Procedures

- `PostAndSend(var SalesHeader: Record "Sales Header")`: Posts the sales document and sends it to the customer using the configured document sending profile.
- `Preview(var SalesHeader: Record "Sales Header")`: Previews the posting of the sales document without actually posting it, showing the expected ledger entries.
- `MessageIfPostingPreviewMultipleDocuments(var SalesHeaderToPreview: Record "Sales Header"; DocumentNo: Code[20])`: Displays a message if previewing multiple sales documents and indicates which document is being previewed.

Plus 3 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 36 "Sales Header"](../table/36.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 80 "Sales-Post"](../codeunit/80.md) (4 calls: `OnRunPreview → (object)`, `OnRunPreview → SetPreviewMode`, `RunSalesPost → (object)`, …)
- [Codeunit 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (2 calls: `MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments`, `Preview → Preview`)
- [Codeunit 88 "Sales Post via Job Queue"](../codeunit/88.md) (1 call: `Code → EnqueueSalesDoc`)
- [Codeunit 9070 "Document Errors Mgt."](../codeunit/9070.md) (1 call: `OnRun → GetNothingToPostErrorMsg`)
- [Codeunit 99 "Posting Selection Management"](../codeunit/99.md) (1 call: `ConfirmPost → ConfirmPostSalesDocument`)

## Called by

- [Page 9301 "Sales Invoice List"](../page/9301.md) (2 calls: `ShowPreview → MessageIfPostingPreviewMultipleDocuments`, `ShowPreview → Preview`)
- [Page 9305 "Sales Order List"](../page/9305.md) (2 calls: `ShowPreview → MessageIfPostingPreviewMultipleDocuments`, `ShowPreview → Preview`)
- [Codeunit 79 "Sales-Post and Send"](../codeunit/79.md) (1 call: `Code → PostAndSend`)
- [Page 42 "Sales Order"](../page/42.md) (1 call: `ShowPreview → Preview`)
- [Page 43 "Sales Invoice"](../page/43.md) (1 call: `ShowPreview → Preview`)
- [Page 44 "Sales Credit Memo"](../page/44.md) (1 call: `ShowPreview → Preview`)
- [Page 6630 "Sales Return Order"](../page/6630.md) (1 call: `ShowPreview → Preview`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-26

## Countries that replace it

[AU](../../localizations/au.md), [NZ](../../localizations/nz.md)

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: "Sales-Post (Yes/No)")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
