---
title: "Codeunit 8060 Create Billing Documents"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/
type: codeunit
id: 8060
name: "Create Billing Documents"
app: "Subscription Billing"
namespace: Microsoft.SubscriptionBilling
versions: "26-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/source/?v=28 https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/source/"
checked: 2026-11-20
changed: 2026-10-28
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 8060 Create Billing Documents

JOP-AL, https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/

| | |
| --- | --- |
| App | Subscription Billing |
| Namespace | Microsoft.SubscriptionBilling |
| Versions | 26-29 |
| Minors | W1 26.0-29.0; DE 26.0-29.0; US 26.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/editions.json) |
| TableNo | Billing Line |
| Source file | Billing/Codeunits/CreateBillingDocuments.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| GetContractTypeDescription | (ContractNo: Code[20]; Partner: Enum "Service Partner"; LanguageCode: Code[10]) | Text[50] | internal | 26-29 | - | - |
| SetPurchaseHeaderFromExistingPurchaseDocument | (DocumentType: Enum "Purchase Document Type"; DocumentNo: Code[20]) | - | internal | 26-29 | - | - |
| SetSkipRequestPageSelection | (NewSkipRequestPageSelection: Boolean) | - | public | 26-29 | - | - |
| SetDocumentDataFromRequestPage | (DocumentDateValue: Date; PostingDateValue: Date; PostDocumentValue: Boolean; CreateContractInvoiceValue: Boolean) | - | public | 26-29 | - | - |
| SetBillingGroupingPerContract | (ServicePartner: Enum "Service Partner") | - | public | 26-29 | - | - |
| GetBillingPeriodDescriptionTxt | () | Text | public | 26-29 | - | - |
| GetBillingPeriodDescriptionTxt | (LanguageCode: Code[10]) | Text | public | 26-29 | - | - |
| SetHideProcessingFinishedMessage | () | - | internal | 26-29 | - | - |
| ErrorIfItemUnitOfMeasureCodeDoesNotExist | (ItemNo: Code[20]; ServiceObject: Record "Subscription Header") | - | internal | 26 | - | - |
| ErrorIfItemUnitOfMeasureCodeDoesNotExist | (BillingLine: Record "Billing Line"; InvoicingItemNo: Code[20]; SubscriptionHeader: Record "Subscription Header") | - | internal | 27-29 | - | - |
| SetAutomatedBilling | (NewAutomatedBilling: Boolean) | - | internal | 27-29 | - | - |
| SetCustomerRecurringBillingGrouping | (NewCustomerRecurringBillingGrouping: Enum "Customer Rec. Billing Grouping") | - | public | 27-29 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCreateSalesHeaderFromContract | (CustomerSubscriptionContract: Record "Customer Subscription Contract"; var SalesHeader: Record "Sales Header") | 26-29 | - | - |
| Integration event | OnAfterCreateSalesHeaderForCustomerNo | (var SalesHeader: Record "Sales Header"; ContractNo: Code[20]) | 26-29 | - | - |
| Integration event | OnBeforeInsertSalesLineFromContractLine | (var SalesLine: Record "Sales Line"; var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnBeforeInsertContractDescriptionSalesLines | (SalesHeader: Record "Sales Header"; BillingLine: Record "Billing Line"; var FirstContractDescriptionLineInserted: Boolean; CustomerRecurringBillingGrouping: Enum "Customer Rec. Billing Grouping"; var IsHandled: Boolean) | 26-29 | - | - |
| Integration event | OnAfterInsertContractDescriptionSalesLines | (SalesHeader: Record "Sales Header"; BillingLine: Record "Billing Line"; var FirstContractDescriptionLineInserted: Boolean; CustomerRecurringBillingGrouping: Enum "Customer Rec. Billing Grouping") | 26-29 | - | - |
| Integration event | OnAfterInsertSalesLineFromBillingLine | (CustomerContractLine: Record "Cust. Sub. Contract Line"; SalesLine: Record "Sales Line") | 26-29 | - | - |
| Integration event | OnAfterInsertPurchaseLineFromBillingLine | (SubscriptionLine: Record "Subscription Line"; PurchaseLine: Record "Purchase Line") | 26-29 | - | - |
| Integration event | OnBeforeInsertPurchaseLineFromContractLine | (var PurchLine: Record "Purchase Line"; var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnAfterCreateAdditionalInvoiceLines | (SalesHeader: Record "Sales Header"; ParentSalesLine: Record "Sales Line"; ServiceObject: Record "Subscription Header"; SubscriptionLine: Record "Subscription Line") | 26-29 | - | - |
| Integration event | OnGetAdditionalLineTextElseCase | (ContractInvoiceTextType: Enum "Contract Invoice Text Type"; SubscriptionHeader: Record "Subscription Header"; SubscriptionLine: Record "Subscription Line"; var DescriptionText: Text; var IsHandled: Boolean) | 26-29 | - | - |
| Integration event | OnBeforeInsertAddressInfoForCollectiveInvoice | (BillingLine: Record "Billing Line"; CustomerRecurringBillingGrouping: Enum "Customer Rec. Billing Grouping"; SalesHeader: Record "Sales Header"; var IsHandled: Boolean) | 26-29 | - | - |
| Integration event | OnAfterInsertAddressInfoForCollectiveInvoice | (BillingLine: Record "Billing Line"; CustomerRecurringBillingGrouping: Enum "Customer Rec. Billing Grouping"; SalesHeader: Record "Sales Header") | 26-29 | - | - |
| Integration event | OnCreateTempBillingLinesBeforeSaveTempBillingLine | (var TempBillingLine: Record "Billing Line" temporary; var BillingLine: Record "Billing Line") | 26-29 | - | - |
| Integration event | OnBeforeInsertTempBillingLine | (var TempBillingLine: Record "Billing Line" temporary; var BillingLine: Record "Billing Line") | 26-29 | - | - |
| Integration event | OnBeforeProcessBillingLines | (var BillingLine: Record "Billing Line"; var DocumentDate: Date; var PostingDate: Date; var CustomerRecBillingGrouping: Enum "Customer Rec. Billing Grouping"; var VendorRecBillingGrouping: Enum "Vendor Rec. Billing Grouping"; var PostDocuments: Boolean) | 26-29 | - | - |
| Integration event | OnAfterProcessBillingLines | (var BillingLine: Record "Billing Line") | 26-29 | - | - |
| Integration event | OnBeforeCreateBillingDocuments | (var BillingLine: Record "Billing Line") | 26-29 | - | - |
| Integration event | OnAfterIsNewSalesHeaderNeeded | (var CreateNewSalesHeader: Boolean; TempBillingLine: Record "Billing Line" temporary; PreviousCustomerNo: Code[20]; LastDetailOverview: Enum "Contract Detail Overview"; PreviousCurrencyCode: Code[20]; PreviousContractNo: Code[20]) | 26-29 | - | - |
| Integration event | OnAfterIsNewHeaderNeededPerContract | (var CreateNewSalesHeader: Boolean; TempBillingLine: Record "Billing Line" temporary; PreviousSubContractNo: Code[20]) | 26-29 | - | - |
| Integration event | OnBeforeTestPreviousDocumentTotalInvoiceAmount | (Sales: Boolean; DiscountLineExists: Boolean; PreviousContractNo: Code[20]; SalesHeader: Record "Sales Header"; PurchaseHeader: Record "Purchase Header") | 26-29 | - | - |
| Integration event | OnAfterCustomerContractLineGetInInsertSalesLineFromTempBillingLine | (CustomerContractLine: Record "Cust. Sub. Contract Line"; SalesHeader: Record "Sales Header"; var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnCreateSalesDocumentsPerContractBeforeTempBillingLineFindSet | (var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnCreatePurchaseDocumentsPerContractBeforeTempBillingLineFindSet | (var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnCreateSalesDocumentsPerCustomerBeforeTempBillingLineFindSet | (var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnCreatePurchaseDocumentsPerVendorBeforeTempBillingLineFindSet | (var TempBillingLine: Record "Billing Line" temporary) | 26-29 | - | - |
| Integration event | OnAfterCreateAdditionalInvoiceLine | (var SalesLine: Record "Sales Line"; ParentSalesLine: Record "Sales Line") | 26-29 | - | - |
| Integration event | OnAfterGetAdditionalLineText | (SubscriptionContractSetupFieldNo: Integer; ParentSalesLine: Record "Sales Line"; SubscriptionHeader: Record "Subscription Header"; ServiceCommitment: Record "Subscription Line"; var DescriptionText: Text) | 26-29 | - | - |
| Integration event | OnCheckBillingLinesOnBeforeDataChecks | (var BillingLine: Record "Billing Line"; var ShouldCheckDataConsistency: Boolean; var ShouldCheckItemUnitOfMeasures: Boolean) | 28-29 | - | - |
| Integration event | OnCheckBillingLineDataOnBeforeNextBillingLine | (var BillingLine: Record "Billing Line") | 28-29 | - | - |

## Source

Symbols: Microsoft.SubscriptionBilling.symbols.3099ffc7-4cf7-4df6-9b96-7e4bc2bb587c, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 28: https://github.com/microsoft/BCApps, MIT, releases/28.x at 408a4cc8d3a4c54b60464cc14c964479facb9ba0.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
