---
id: object/codeunit/5981
type: object
title: Codeunit 5981 "Service-Post (Yes/No)"
summary: Codeunit 5981 "Service-Post (Yes/No)" in Base Application (Microsoft.Service.Posting). 7 public procedures, 7 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, 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: 1fe7adfe71c0d25e5c0997a23551160be6abf6fdd4d5c60cd7b3914800a98ad7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Service/Posting/ServicePostYesNo.Codeunit.al
    title: src/Layers/W1/BaseApp/Service/Posting/ServicePostYesNo.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: 5981
name: Service-Post (Yes/No)
namespace: Microsoft.Service.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"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 17
  events: 7
  subscribers: 1
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 5
  called_by: 1
  implements: 0
---

# Codeunit 5981 "Service-Post (Yes/No)"

> Codeunit 5981 "Service-Post (Yes/No)" in Base Application (Microsoft.Service.Posting). 7 public procedures, 7 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24-25, BC28.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Service Line |

## Events published

- `OnAfterConfirmPost(var ServiceHeader: Record "Service Header"; Ship: Boolean; Consume: Boolean; Invoice: Boolean)` (integration)
- `OnAfterPost(var PassedServiceHeader: Record "Service Header")` (integration)
- `OnBeforeConfirmServPost(var ServiceHeader: Record "Service Header"; var HideDialog: Boolean; var Ship: Boolean; var Consume: Boolean; var Invoice: Boolean; var IsHandled: Boolean; PreviewMode: Boolean; var ServiceLine: Record "Service Line")` (integration)
- `OnBeforePostDocument(var ServiceHeader: Record "Service Header"; var ServiceLine: Record "Service Line" temporary)` (integration)
- `OnBeforePostDocumentWithLines(var ServiceHeader: Record "Service Header"; var ServiceLine: Record "Service Line")` (integration)
- `OnBeforePreviewDocument(var ServHeader: Record "Service Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeConfirmPost(var ServiceHeader: Record "Service Header"; var Ship: Boolean; var Consume: Boolean; var Invoice: Boolean; var DefaultOption: Integer; PreviewMode: Boolean; var Result: Boolean; var IsHandled: Boolean)` (integration)

## Event subscriptions

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

## Procedures

- `PostDocument(var ServiceHeaderSource: Record "Service Header")`
- `PostDocumentWithLines(var ServiceHeaderSource: Record "Service Header"; var PassedServLine: Record "Service Line")`
- `PreviewDocument(var ServHeader: Record "Service Header")`
- `MessageIfPostingPreviewMultipleDocuments(var ServiceHeaderToPreview: Record "Service Header"; DocumentNo: Code[20])`
- `PreviewDocumentWithLines(var ServHeader: Record "Service Header"; var PassedServLine: Record "Service Line")`
- `SetGlobalServiceHeader(var ServiceHeader: Record "Service Header")`
- `GetGlobalServiceHeader(var ServiceHeader: Record "Service Header")`

Plus 2 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 5902 "Service Line"](../table/5902.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 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (3 calls: `MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments`, `PreviewDocument → Preview`, `PreviewDocumentWithLines → Preview`)
- [Codeunit 5980 "Service-Post"](../codeunit/5980.md) (2 calls: `Code → PostWithLines`, `Code → SetPreviewMode`)
- [Codeunit 5957 "Serv. Posting Selection Mgt."](../codeunit/5957.md) (1 call: `ConfirmPost → ConfirmPostServiceDocument`)
- [Codeunit 9070 "Document Errors Mgt."](../codeunit/9070.md) (1 call: `Code → GetNothingToPostErrorMsg`)
- [Codeunit 9500 "Sequence No. Mgt."](../codeunit/9500.md) (1 call: `OnRun → SetPreviewMode`)

## Called by

- [Table 5900 "Service Header"](../table/5900.md) (3 calls: `SendToPostWithLines → (object)`, `SendToPostWithLines → GetGlobalServiceHeader`, `SendToPostWithLines → SetGlobalServiceHeader`)

## Across versions

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