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

# Codeunit 817 "Service Post Invoice"

> Codeunit 817 "Service Post Invoice" in Base Application (Microsoft.Service.Posting). 16 public procedures. Present since at least BC23, still in BC30, changed in BC25-26.

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

## Procedures

- `Check(TableID: Integer)`
- `ClearBuffers()`
- `SetPreviewMode(NewPreviewMode: Boolean)`
- `SetSuppressCommit(NewSuppressCommit: Boolean)`
- `SetHideProgressWindow(NewHideProgressWindow: Boolean)`
- `SetParameters(NewInvoicePostingParameters: Record "Invoice Posting Parameters")`
- `SetTotalLines(TotalDocumentLine: Variant; TotalDocumentLineLCY: Variant)`
- `PrepareLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant; DocumentLineACYVar: Variant)`
- `PrepareInvoicePostingBuffer(var ServiceLine: Record "Service Line"; var InvoicePostingBuffer: Record "Invoice Posting Buffer")`
- `PostLines(DocumentHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var Window: Dialog; var TotalAmount: Decimal)`
- `CheckCreditLine(SalesHeaderVar: Variant; SalesLineVar: Variant)`
- `PostLedgerEntry(ServiceHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")`
- `PostBalancingEntry(ServiceHeaderVar: Variant; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")`
- `PrepareJobLine(SalesHeaderVar: Variant; SalesLineVar: Variant; SalesLineACYVar: Variant)`
- `CalcDeferralAmounts(ServiceHeaderVar: Variant; ServiceLineVar: Variant; OriginalDeferralAmount: Decimal)`
- `CreatePostedDeferralSchedule(ServiceLineVar: Variant; NewDocumentType: Integer; NewDocumentNo: Code[20]; NewLineNo: Integer; PostingDate: Date)`

Plus 8 local procedures.

## 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 827 "Service Post Invoice Events"](../codeunit/827.md) (25 calls: `CalcInvoiceDiscountPosting → RunOnBeforeCalcInvoiceDiscountPosting`, `CalcLineDiscountPosting → RunOnBeforeCalcLineDiscountPosting`, `GetSalesAccount → RunOnAfterGetSalesAccount`, …)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (3 calls: `PostBalancingEntry → RunWithCheck`, `PostLedgerEntry → RunWithCheck`, `PostLines → RunWithCheck`)

## Implements

- [Interface "Invoice Posting"](../interface/invoice-posting.md)

## Across versions

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

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 Invoice")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
