{"title":"Codeunit 368 Format Document, events","url":"https://jonas-paprotka.de/ref/codeunit/368-format-document/events/","author":"JOP-AL","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/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":368,"name":"Format Document","app":"Base Application","versions":"17-29","url":"https://jonas-paprotka.de/ref/codeunit/368-format-document/","json":"https://jonas-paprotka.de/ref/codeunit/368-format-document.json"},"aspect":"events","total":13,"rows":[{"name":"OnAfterSetSalesPurchaseLine","sig":"(Decimal, Decimal, Decimal, Decimal, Code[10], var Text, var Text, var Text, var Text)","named":"(Quantity: Decimal; UnitPrice: Decimal; VATPercentage: Decimal; LineAmount: Decimal; CurrencyCode: Code[10]; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-18","first":17,"last":18,"obsoleteSince":null,"spans":[{"from":17,"to":18,"named":"(Quantity: Decimal; UnitPrice: Decimal; VATPercentage: Decimal; LineAmount: Decimal; CurrencyCode: Code[10]; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterSetSalesLine","sig":"(var Record Sales Line, var Text, var Text, var Text, var Text)","named":"(var SalesLine: Record \"Sales Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesLine: Record \"Sales Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterSetSalesInvoiceLine","sig":"(var Record Sales Invoice Line, var Text, var Text, var Text, var Text)","named":"(var SalesInvoiceLine: Record \"Sales Invoice Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesInvoiceLine: Record \"Sales Invoice Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterSetSalesCrMemoLine","sig":"(var Record Sales Cr.Memo Line, var Text, var Text, var Text, var Text)","named":"(var SalesCrMemoLine: Record \"Sales Cr.Memo Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesCrMemoLine: Record \"Sales Cr.Memo Line\"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetLogoPosition","sig":"(var Option, var Record Company Information, var Record Company Information, var Record Company Information, var Boolean)","named":"(var LogoPosition: Option \"No Logo\",Left,Center,Right; var CompanyInfo1: Record \"Company Information\"; var CompanyInfo2: Record \"Company Information\"; var CompanyInfo3: Record \"Company Information\"; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var LogoPosition: Option \"No Logo\",Left,Center,Right; var CompanyInfo1: Record \"Company Information\"; var CompanyInfo2: Record \"Company Information\"; var CompanyInfo3: Record \"Company Information\"; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetSalesLine","sig":"(var Record Sales Line)","named":"(var SalesLine: Record \"Sales Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesLine: Record \"Sales Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetSalesInvoiceLine","sig":"(var Record Sales Invoice Line)","named":"(var SalesInvoiceLine: Record \"Sales Invoice Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesInvoiceLine: Record \"Sales Invoice Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetSalesCrMemoLine","sig":"(var Record Sales Cr.Memo Line)","named":"(var SalesCrMemoLine: Record \"Sales Cr.Memo Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"17-29","first":17,"last":29,"obsoleteSince":null,"spans":[{"from":17,"to":29,"named":"(var SalesCrMemoLine: Record \"Sales Cr.Memo Line\")","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterSetSalesPurchaseLine","sig":"(Decimal, Decimal, Decimal, Decimal, Code[10], var Text, var Text, var Text, var Text, Boolean)","named":"(Quantity: Decimal; UnitPrice: Decimal; VATPercentage: Decimal; LineAmount: Decimal; CurrencyCode: Code[10]; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text; CommentLine: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"19-29","first":19,"last":29,"obsoleteSince":null,"spans":[{"from":19,"to":29,"named":"(Quantity: Decimal; UnitPrice: Decimal; VATPercentage: Decimal; LineAmount: Decimal; CurrencyCode: Code[10]; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text; CommentLine: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterSetTotalLabels","sig":"(Code[10], var Text[50], var Text[50], var Text[50])","named":"(CurrencyCode: Code[10]; var TotalText: Text[50]; var TotalInclVATText: Text[50]; var TotalExclVATText: Text[50])","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"19-29","first":19,"last":29,"obsoleteSince":null,"spans":[{"from":19,"to":29,"named":"(CurrencyCode: Code[10]; var TotalText: Text[50]; var TotalInclVATText: Text[50]; var TotalExclVATText: Text[50])","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetPurchaser","sig":"(var Record Salesperson/Purchaser, Code[20], var Text[50], var Boolean)","named":"(var SalespersonPurchaser: Record \"Salesperson/Purchaser\"; Code: Code[20]; var PurchaserText: Text[50]; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"19-29","first":19,"last":29,"obsoleteSince":null,"spans":[{"from":19,"to":29,"named":"(var SalespersonPurchaser: Record \"Salesperson/Purchaser\"; Code: Code[20]; var PurchaserText: Text[50]; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnBeforeSetSalesPerson","sig":"(var Record Salesperson/Purchaser, Code[20], var Text[50], var Boolean)","named":"(var SalespersonPurchaser: Record \"Salesperson/Purchaser\"; Code: Code[20]; var SalesPersonText: Text[50]; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"19-29","first":19,"last":29,"obsoleteSince":null,"spans":[{"from":19,"to":29,"named":"(var SalespersonPurchaser: Record \"Salesperson/Purchaser\"; Code: Code[20]; var SalesPersonText: Text[50]; var IsHandled: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]},{"name":"OnAfterHideDocumentLine","sig":"(Boolean, Variant, Integer, var Boolean)","named":"(HideLinesWithZeroQuantity: Boolean; RecordVariant: Variant; QuantityFieldId: Integer; var HideLine: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null,"range":"25-29","first":25,"last":29,"obsoleteSince":null,"spans":[{"from":25,"to":29,"named":"(HideLinesWithZeroQuantity: Boolean; RecordVariant: Variant; QuantityFieldId: Integer; var HideLine: Boolean)","returns":"","kind":"integrationevent","access":"local","obsolete":null}]}]}