---
id: object/codeunit/443
type: object
title: Codeunit 443 "Sales-Post Prepayment (Yes/No)"
summary: Codeunit 443 "Sales-Post Prepayment (Yes/No)" in Base Application (Microsoft.Sales.Posting). 5 public procedures, 8 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in 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: 6b5e6d7e721ca0d5b5b5f9ea665221d553fab3eea06d31822aa2fb272ec978d2
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Posting/SalesPostPrepaymentYesNo.Codeunit.al
    title: src/Layers/W1/BaseApp/Sales/Posting/SalesPostPrepaymentYesNo.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10128
object_type: codeunit
object_id: 443
name: Sales-Post Prepayment (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:
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 16
  events: 8
  subscribers: 1
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 5
  called_by: 1
  implements: 0
---

# Codeunit 443 "Sales-Post Prepayment (Yes/No)"

> Codeunit 443 "Sales-Post Prepayment (Yes/No)" in Base Application (Microsoft.Sales.Posting). 5 public procedures, 8 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC28.

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

## Events published

- `OnAfterPostPrepmtInvoiceYN(var SalesHeader: Record "Sales Header")` (integration): Raised after posting the prepayment invoice for a sales order.
- `OnAfterPostPrepmtCrMemoYN(var SalesHeader: Record "Sales Header")` (integration): Raised after posting the prepayment credit memo for a sales order.
- `OnBeforeGetReport(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; var IsHandled: Boolean)` (integration): Raised before getting the report to print the prepayment document.
- `OnBeforeConfirmForDocument(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)` (integration): Raised before displaying the confirmation dialog for posting the prepayment document.
- `OnBeforePostPrepmtDocument(var SalesHeader: Record "Sales Header"; PrepmtDocumentType: Option)` (integration): Raised before posting the prepayment document.
- `OnPostPrepmtInvoiceYNOnBeforeConfirm(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration): Raised before confirming the posting of the prepayment invoice.
- `OnPostPrepmtCrMemoYNOnBeforeConfirm(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)` (integration): Raised before confirming the posting of the prepayment credit memo.
- `OnPostPrepmtDocumentOnBeforeRunSalesPostPrepayments(var SalesHeader: Record "Sales Header"; var SuppressCommit: Boolean)` (integration): Raised before running the Sales-Post Prepayments codeunit.

## Event subscriptions

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

## Procedures

- `PostPrepmtInvoiceYN(var SalesHeader2: Record "Sales Header"; Print: Boolean)`: Posts a prepayment invoice for the sales order after prompting the user for confirmation.
- `PostPrepmtCrMemoYN(var SalesHeader2: Record "Sales Header"; Print: Boolean)`: Posts a prepayment credit memo for the sales order after prompting the user for confirmation.
- `Preview(var SalesHeader: Record "Sales Header"; DocumentType: Option)`: Previews the posting of a prepayment document without actually posting it.
- `GetReport(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo")`: Prints the posted prepayment invoice or credit memo.
- `SetDocumentType(NewPrepmtDocumentType: Option)`: Sets the prepayment document type to be used for posting.

Plus 2 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 442 "Sales-Post Prepayments"](../codeunit/442.md) (6 calls: `OnRunPreview → (object)`, `OnRunPreview → SetDocumentType`, `OnRunPreview → SetPreviewMode`, …)
- [Codeunit 28 "Error Message Management"](../codeunit/28.md) (2 calls: `PostPrepmtDocument → Activate`, `PostPrepmtDocument → PushContext`)
- [Codeunit 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (1 call: `Preview → Preview`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `ConfirmForDocument → GetResponseOrDefault`)
- [Codeunit 29 "Error Message Handler"](../codeunit/29.md) (1 call: `PostPrepmtDocument → ShowErrors`)

## Called by

- [Page 42 "Sales Order"](../page/42.md) (2 calls: `ShowPrepmtCrMemoPreview → Preview`, `ShowPrepmtInvoicePreview → Preview`)

## Recent changes

- 2026-08-13 [#10128 [Extensibility Request] issue 30357: add prepayment credit memo confirmation event](../../changes/bcapps/10128.md) (main, BC30, feature)

## Across versions

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