---
title: "Codeunit 5981 Service-Post (Yes/No)"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5981-service-post-yes-no/
type: codeunit
id: 5981
name: "Service-Post (Yes/No)"
app: "Base Application"
namespace: Microsoft.Service.Posting
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5981-service-post-yes-no/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 5981 Service-Post (Yes/No)

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5981-service-post-yes-no/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Service.Posting |
| Versions | 17-28 |
| Source file | Service/Posting/ServicePostYesNo.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| PostDocument | (var Record Service Header) | - | public | 17-28 | - | - |
| PostDocumentWithLines | (var Record Service Header, var Record Service Line) | - | public | 17-28 | - | - |
| PreviewDocument | (var Record Service Header) | - | public | 17-28 | - | - |
| PreviewDocumentWithLines | (var Record Service Header, var Record Service Line) | - | public | 17-28 | - | - |
| SetPreviewContext | (var Record Service Header) | - | public | 17-21 | Pending 19.0 | Replaced by SetGlobalServiceHeader |
| SetGlobalServiceHeader | (var Record Service Header) | - | public | 19-28 | - | - |
| GetGlobalServiceHeader | (var Record Service Header) | - | public | 19-28 | - | - |
| MessageIfPostingPreviewMultipleDocuments | (var Record Service Header, Code[20]) | - | public | 24-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterConfirmPost | (var Record Service Header, Boolean, Boolean, Boolean) | 17-28 | - | - |
| Integration event | OnAfterPost | (var Record Service Header) | 17-28 | - | - |
| Integration event | OnBeforeConfirmServPost | (var Record Service Header, var Boolean, var Boolean, var Boolean, var Boolean, var Boolean, Boolean, var Record Service Line) | 17-28 | - | - |
| Integration event | OnBeforePostDocument | (var Record Service Header, var Record Service Line) | 17-28 | - | - |
| Integration event | OnBeforePostDocumentWithLines | (var Record Service Header, var Record Service Line) | 17-28 | - | - |
| Integration event | OnBeforePreviewDocument | (var Record Service Header, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeConfirmPost | (var Record Service Header, var Boolean, var Boolean, var Boolean, var Integer, Boolean, var Boolean, var Boolean) | 24-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
