---
title: "Codeunit 817 Service Post Invoice"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/817-service-post-invoice/
type: codeunit
id: 817
name: "Service Post Invoice"
app: "Base Application"
namespace: Microsoft.Service.Posting
versions: "19-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/817-service-post-invoice/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 817 Service Post Invoice

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/817-service-post-invoice/

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

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| Check | (Integer) | - | public | 19-28 | - | - |
| ClearBuffers | () | - | public | 19-28 | - | - |
| SetPreviewMode | (Boolean) | - | public | 19-28 | - | - |
| SetSuppressCommit | (Boolean) | - | public | 19-28 | - | - |
| SetHideProgressWindow | (Boolean) | - | public | 19-28 | - | - |
| SetParameters | (Record Invoice Posting Parameters) | - | public | 19-28 | - | - |
| SetTotalLines | (Variant, Variant) | - | public | 19-28 | - | - |
| PrepareLine | (Variant, Variant, Variant) | - | public | 19-28 | - | - |
| PostLines | (Variant, var Codeunit Gen. Jnl.-Post Line, var Dialog, var Decimal) | - | public | 19-28 | - | - |
| CheckCreditLine | (Variant, Variant) | - | public | 19-28 | - | - |
| PostLedgerEntry | (Variant, var Codeunit Gen. Jnl.-Post Line) | - | public | 19-28 | - | - |
| PostBalancingEntry | (Variant, var Codeunit Gen. Jnl.-Post Line) | - | public | 19-28 | - | - |
| PrepareJobLine | (Variant, Variant, Variant) | - | public | 19-28 | - | - |
| CalcDeferralAmounts | (Variant, Variant, Decimal) | - | public | 19-28 | - | - |
| CreatePostedDeferralSchedule | (Variant, Integer, Code[20], Integer, Date) | - | public | 19-28 | - | - |
| PrepareInvoicePostingBuffer | (var Record Service Line, var Record Invoice Posting Buffer) | - | public | 25-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnPostBalancingEntryOnAfterGenJnlPostLine | (var Record Gen. Journal Line, Record Service Header, var Record Service Line, var Record Service Line, Boolean, Boolean, var Codeunit Gen. Jnl.-Post Line) | 19-22 | Pending 20.0 | Replaced by RunOnPostBalancingEntryOnAfterGenJnlPostLine in codeunit Service Post Invoice Subscr. |
| Integration event | OnPostBalancingEntryOnBeforeGenJnlPostLine | (var Record Gen. Journal Line, Record Service Header, var Record Service Line, var Record Service Line, Boolean, Boolean, var Codeunit Gen. Jnl.-Post Line) | 19-22 | Pending 20.0 | Replaced by RunOnPostBalancingEntryOnBeforeGenJnlPostLine in codeunit Service Post Invoice Subscr. |
| Integration event | OnPostLedgerEntryOnAfterGenJnlPostLine | (var Record Gen. Journal Line, Record Service Header, var Record Service Line, var Record Service Line, Boolean, Boolean, var Codeunit Gen. Jnl.-Post Line) | 19-22 | Pending 20.0 | Replaced by RunOnPostLedgerEntryOnAfterGenJnlPostLine in codeunit Service Post Invoice Subscr. |
| Integration event | OnPostLedgerEntryOnBeforeGenJnlPostLine | (var Record Gen. Journal Line, Record Service Header, var Record Service Line, var Record Service Line, Boolean, Boolean, var Codeunit Gen. Jnl.-Post Line) | 19-22 | Pending 20.0 | Replaced by RunOnPostLedgerEntryOnBeforeGenJnlPostLine in codeunit Service Post Invoice Subscr. |

## 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.
