You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Event][Subscription Billing] Add extensibility event after inserting contract description lines in purchase billing documents #12771
We need to add additional contract-specific information immediately after the standard contract description lines in generated purchase invoices. While this scenario is fully supported in sales billing through the existing OnAfterInsertContractDescriptionSalesLines event, there is currently no supported extension point to achieve the same result in purchase billing.
Providing an equivalent event would align both subscription billing processes and ensure a consistent extensibility model across sales and purchasing.
The sales subscription billing process already exposes extensibility events before and after the standard contract description lines are inserted into generated sales documents. These events allow partners to add contract-specific information at the exact point where a new contract section begins within the document.
The purchase subscription billing process contains comparable functionality and inserts equivalent contract description lines, but no corresponding extensibility event is available. This prevents partners from implementing the same customizations and creates an unnecessary inconsistency between sales and purchase subscription billing extensibility.
We need to add additional contract-specific information immediately after the standard contract description lines in generated purchase invoices. While this scenario is fully supported in sales billing through the existing OnAfterInsertContractDescriptionSalesLines event, there is currently no supported extension point to achieve the same result in purchase billing.
Providing an equivalent event would align both subscription billing processes and ensure a consistent extensibility model across sales and purchasing.
Describe the request
The sales subscription billing process already provides extensibility events around the insertion of contract description lines (OnBeforeInsertContractDescriptionSalesLines and OnAfterInsertContractDescriptionSalesLines). However, the purchase subscription billing process does not provide equivalent extensibility points, creating an inconsistency between the sales and purchase subscription billing APIs.
We request an integration event to be raised after the standard contract description lines are inserted into generated purchase documents, allowing partners to extend the process in the same way currently supported for sales billing documents.
The purchase subscription billing process does not provide equivalent extensibility points when contract description lines are inserted into the generated purchase document.
As a result, partners cannot add contract-specific information immediately after the standard contract description lines, nor can they extend this part of the process in a consistent way across sales and purchase subscription billing.
We request an event equivalent to the existing sales event to be raised after the standard contract description lines are inserted into purchase documents.
For example:
[IntegrationEvent(false, false)]
local procedure OnAfterInsertContractDescriptionPurchaseLines(
PurchaseHeader: Record "Purchase Header";
BillingLine: Record "Billing Line";
FirstContractDescriptionLineInserted: Boolean;
VendorRecurringBillingGrouping: Enum "Vendor Rec. Billing Grouping")
begin
end;
Alternatively, Microsoft could expose both OnBefore... and OnAfter... events to provide the same extensibility model available in the sales billing process.
Business impact
Without this event, partners must rely on unsupported workarounds or modifications of the standard process to enrich generated purchase documents with contract-specific information.
Adding the event would:
Improve extensibility of the purchase subscription billing process.
Align purchase billing extensibility with the existing sales billing model.
Reduce customization effort and upgrade risks.
Enable partner solutions that require additional contract information in generated purchase invoices.
Provide an implementation (optional)
I will provide the implementation for this extensibility request
✅ Analysis complete - ready for further processing
Implementation:
Add matching purchase subscription billing integration events around InsertContractDescriptionPurchaseLines, including an OnAfterInsertContractDescriptionPurchaseLines event after the standard contract description lines are inserted, and an OnBeforeInsertContractDescriptionPurchaseLines event with IsHandled for parity with the sales extensibility model.
Location in InsertContractDescriptionPurchaseLines procedure:
localprocedure InsertContractDescriptionPurchaseLines(BillingLine: Record "Billing Line")var
ContractTypeDescription: Text;
IsHandled: Boolean; // NEWbegin
IsHandled := false; // NEW
OnBeforeInsertContractDescriptionPurchaseLines(PurchaseHeader, BillingLine, FirstContractDescriptionLineInserted, VendorRecurringBillingGrouping, IsHandled); // NEWifnot IsHandled thenbegin// NEW
TranslationHelper.SetGlobalLanguageByCode(PurchaseHeader."Language Code");
if FirstContractDescriptionLineInserted then
InsertDescriptionPurchaseLine('', 0);
InsertDescriptionPurchaseLine(StrSubstNo(ContractNoTxt, BillingLine."Subscription Contract No."), 0);
ContractTypeDescription := GetContractTypeDescription(BillingLine."Subscription Contract No.", BillingLine.Partner, PurchaseHeader."Language Code");
if ContractTypeDescription <> ''then
InsertDescriptionPurchaseLine(ContractTypeDescription, 0);
if VendorRecurringBillingGrouping <> VendorRecurringBillingGrouping::Contract then
FirstContractDescriptionLineInserted := true;
TranslationHelper.RestoreGlobalLanguage();
end; // NEW
OnAfterInsertContractDescriptionPurchaseLines(PurchaseHeader, BillingLine, FirstContractDescriptionLineInserted, VendorRecurringBillingGrouping); // NEWend;
Event Publisher (add at the end of the codeunit with other events):
[IntegrationEvent(false, false)]
localprocedure OnBeforeInsertContractDescriptionPurchaseLines(PurchaseHeader: Record "Purchase Header"; BillingLine: Record "Billing Line"; var FirstContractDescriptionLineInserted: Boolean; VendorRecurringBillingGrouping: Enum "Vendor Rec. Billing Grouping"; var IsHandled: Boolean)beginend;
[IntegrationEvent(false, false)]
localprocedure OnAfterInsertContractDescriptionPurchaseLines(PurchaseHeader: Record "Purchase Header"; BillingLine: Record "Billing Line"; var FirstContractDescriptionLineInserted: Boolean; VendorRecurringBillingGrouping: Enum "Vendor Rec. Billing Grouping")beginend;
File:CreateBillingDocuments.Codeunit.al
Note
Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.
Tip
Is the triage result incorrect? Reply with /not-accurate and briefly explain what was wrong. Your feedback improves future responses.
Activity
github-actions commentedon Oct 13, 2026
✅ Analysis complete - ready for further processing
Implementation:
Add matching purchase subscription billing integration events around
InsertContractDescriptionPurchaseLines, including anOnAfterInsertContractDescriptionPurchaseLinesevent after the standard contract description lines are inserted, and anOnBeforeInsertContractDescriptionPurchaseLinesevent withIsHandledfor parity with the sales extensibility model.Location in
InsertContractDescriptionPurchaseLinesprocedure:Event Publisher (add at the end of the codeunit with other events):
File:
CreateBillingDocuments.Codeunit.alNote
Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.
Tip
Is the triage result incorrect? Reply with
/not-accurateand briefly explain what was wrong. Your feedback improves future responses.