---
title: "Codeunit 368 Format Document"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/368-format-document/
type: codeunit
id: 368
name: "Format Document"
app: "Base Application"
namespace: Microsoft.Utilities
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/368-format-document/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 368 Format Document

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/368-format-document/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Utilities |
| Versions | 17-28 |
| Source file | Utilities/FormatDocument.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| GetRecordFiltersWithCaptions | (Variant) | Text | public | 17-28 | - | - |
| GetCOPYText | () | Text[30] | public | 17-28 | - | - |
| ParseComment | (Text[80], var Text[100], var Text[100]) | - | public | 17-28 | - | - |
| SetTotalLabels | (Code[10], var Text[50], var Text[50], var Text[50]) | - | public | 17-28 | - | - |
| SetLogoPosition | (Option, var Record Company Information, var Record Company Information, var Record Company Information) | - | public | 17-28 | - | - |
| SetPaymentMethod | (var Record Payment Method, Code[10], Code[10]) | - | public | 17-28 | - | - |
| SetPaymentTerms | (var Record Payment Terms, Code[10], Code[10]) | - | public | 17-28 | - | - |
| SetPurchaser | (var Record Salesperson/Purchaser, Code[20], var Text[50]) | - | public | 17-28 | - | - |
| SetShipmentMethod | (var Record Shipment Method, Code[10], Code[10]) | - | public | 17-28 | - | - |
| SetSalesPerson | (var Record Salesperson/Purchaser, Code[20], var Text[50]) | - | public | 17-28 | - | - |
| SetText | (Boolean, Text[80]) | Text[80] | public | 17-28 | - | - |
| SetSalesInvoiceLine | (var Record Sales Invoice Line, var Text, var Text, var Text, var Text) | - | public | 17-28 | - | - |
| SetSalesLine | (var Record Sales Line, var Text, var Text, var Text, var Text) | - | public | 17-28 | - | - |
| SetSalesCrMemoLine | (var Record Sales Cr.Memo Line, var Text, var Text, var Text, var Text) | - | public | 17-28 | - | - |
| SetPurchaseLine | (var Record Purchase Line, var Text, var Text, var Text, var Text) | - | public | 17-28 | - | - |
| SetPurchaseLine | (var Record Purchase Line, var Text, var Text) | - | public | 17-28 | - | - |
| HideDocumentLine | (Boolean, Variant, Integer) | Boolean | public | 25-28 | - | - |
| IsLineWithZeroQuantity | (Variant, Integer) | Boolean | public | 25-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterSetSalesPurchaseLine | (Decimal, Decimal, Decimal, Decimal, Code[10], var Text, var Text, var Text, var Text) | 17-18 | - | - |
| Integration event | OnAfterSetSalesLine | (var Record Sales Line, var Text, var Text, var Text, var Text) | 17-28 | - | - |
| Integration event | OnAfterSetSalesInvoiceLine | (var Record Sales Invoice Line, var Text, var Text, var Text, var Text) | 17-28 | - | - |
| Integration event | OnAfterSetSalesCrMemoLine | (var Record Sales Cr.Memo Line, var Text, var Text, var Text, var Text) | 17-28 | - | - |
| Integration event | OnBeforeSetLogoPosition | (var Option, var Record Company Information, var Record Company Information, var Record Company Information, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeSetSalesLine | (var Record Sales Line) | 17-28 | - | - |
| Integration event | OnBeforeSetSalesInvoiceLine | (var Record Sales Invoice Line) | 17-28 | - | - |
| Integration event | OnBeforeSetSalesCrMemoLine | (var Record Sales Cr.Memo Line) | 17-28 | - | - |
| Integration event | OnAfterSetSalesPurchaseLine | (Decimal, Decimal, Decimal, Decimal, Code[10], var Text, var Text, var Text, var Text, Boolean) | 19-28 | - | - |
| Integration event | OnAfterSetTotalLabels | (Code[10], var Text[50], var Text[50], var Text[50]) | 19-28 | - | - |
| Integration event | OnBeforeSetPurchaser | (var Record Salesperson/Purchaser, Code[20], var Text[50], var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeSetSalesPerson | (var Record Salesperson/Purchaser, Code[20], var Text[50], var Boolean) | 19-28 | - | - |
| Integration event | OnAfterHideDocumentLine | (Boolean, Variant, Integer, var Boolean) | 25-28 | - | - |

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