Codeunit 13916 "Export XRechnung Document" (DE)
DE country layer · Microsoft.eServices.EDocument.Formats
Across versions
- BC23-28not present
- BC29-30present
DE country layer · Microsoft.eServices.EDocument.Formats · BC29-30 · source at 4e6a307c · facts from BC29
An object of the DE localization, not part of W1.
Properties
| Property | Value |
|---|---|
| TableNo | Record Export Buffer |
Events published
OnCreateXMLOnBeforeSalesInvXmlDocumentWriteToFile(var XMLDoc: XmlDocument; SalesInvoiceHeader: Record "Sales Invoice Header")(integration)OnCreateXMLOnBeforeSalesCrMemoXmlDocumentWriteToFile(var XMLDoc: XmlDocument; SalesCrMemoHeader: Record "Sales Cr.Memo Header")(integration)OnAfterFindEDocumentService(var EDocumentService: Record "E-Document Service"; EDocumentFormat: Code[20])(integration, obsolete 30.0)OnAfterInsertSalesInvHeaderData(var XMLCurrNode: XmlElement; SalesInvoiceHeader: Record "Sales Invoice Header")(integration)OnAfterInsertSalesCrMemoHeaderData(var XMLCurrNode: XmlElement; SalesCrMemoHeader: Record "Sales Cr.Memo Header")(integration)OnInsertOrderReferenceOnBeforeInsertSalesInvoiceElement(var SalesInvoiceHeader: Record "Sales Invoice Header"; var OrderReferenceElement: XmlElement)(integration)OnInsertOrderReferenceOnBeforeInsertSalesCrMemoElement(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var OrderReferenceElement: XmlElement)(integration)OnDocumentLinesExistOnAfterFilterSalesInvLine(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesInvLine: Record "Sales Invoice Line")(integration)OnDocumentLinesExistOnAfterFilterSalesCrMemoLine(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var SalesCrMemoLine: Record "Sales Cr.Memo Line")(integration)OnAfterCalculateInvoiceLineAmounts(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesInvLine: Record "Sales Invoice Line"; Currency: Record Currency; var LineAmounts: Dictionary of [Text, Decimal])(integration)OnAfterCalculateCrMemoLineAmounts(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; var LineAmounts: Dictionary of [Text, Decimal])(integration)OnAfterGetSetups(var CompanyInformation: Record "Company Information"; var GeneralLedgerSetup: Record "General Ledger Setup")(integration)OnBeforeInsertInvoiceLine(var InvoiceElement: XmlElement; var SalesInvLine: Record "Sales Invoice Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean; var IsHandled: Boolean)(integration)OnBeforeAddInvoiceLineElement(var InvoiceLineElement: XmlElement; var SalesInvLine: Record "Sales Invoice Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean)(integration)OnBeforeInsertCrMemoLine(var CrMemoElement: XmlElement; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean; var IsHandled: Boolean)(integration)OnBeforeAddCrMemoLineElement(var CrMemoLineElement: XmlElement; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean)(integration)OnInsertAttachmentOnAfterSetFilters(TableNo: Integer; DocumentNo: Code[20]; var DocumentAttachment: Record "Document Attachment")(integration): Allows subscribers to add additional filters on the Document Attachment record after the default filters are set.OnInitializeDecimalFormatFlags(var AlwaysIncludeTwoDecimalPlacesForAmountFields: Boolean)(integration): Use this event to always include two decimal places for amount fieldsOnInsertPaymentMeansOnBeforeAddToRoot(var PaymentMeansElement: XmlElement; HeaderRecRef: RecordRef)(integration): Fires immediately before the generated payment means element is added to the document root. Subscribe to inspect or extend the payment block, using HeaderRecRef to access any field of the source document.
Procedures
ExportSalesInvoice(var RecordExportBuffer: Record "Record Export Buffer")ExportSalesCreditMemo(var RecordExportBuffer: Record "Record Export Buffer")ExportServiceInvoice(var RecordExportBuffer: Record "Record Export Buffer")ExportServiceCreditMemo(var RecordExportBuffer: Record "Record Export Buffer")CreateXML(SalesInvoiceHeader: Record "Sales Invoice Header"; var FileOutstream: Outstream)CreateXML(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FileOutstream: Outstream)CreateXML(ServiceInvoiceHeader: Record "Service Invoice Header"; var FileOutstream: Outstream)CreateXML(ServiceCrMemoHeader: Record "Service Cr.Memo Header"; var FileOutstream: Outstream)GetTaxCategoryID(TaxCategory: Code[10]; VATBusPostingGroup: Code[20]; VATProductPostingGroup: Code[20]): Text[10]InsertOrderReference(var RootElement: XmlElement; SalesInvoiceHeader: Record "Sales Invoice Header")InsertOrderReference(var RootElement: XmlElement; SalesCrMemoHeader: Record "Sales Cr.Memo Header")InsertAttachment(var RootElement: XmlElement; TableNo: Integer; DocumentNo: Code[20])AddAttachment(var RootElement: XmlElement; var DocumentAttachment: Record "Document Attachment")SetEDocumentService(NewEDocumentService: Record "E-Document Service")FormatDate(VarDate: Date): Text[20]FormatDecimal(VarDecimal: Decimal): Text[30]FormatDecimal(VarDecimal: Decimal; IncludeDecimalPlaces: Boolean): Text[30]FormatDecimalUnlimited(VarDecimal: Decimal): TextFormatDecimalUnlimited(VarDecimal: Decimal; IncludeMinTwoDecimals: Boolean): TextFormatFourDecimal(VarDecimal: Decimal): Text[30](obsolete 29.0: FormatFourDecimal is no longer used internally. Quantity and unit price fields are now exported with unlimited precision per EN 16931. For VAT percentages, use FormatFiveDecimal. For quantity and unit price, use FormatDecimalUnlimited.)FormatFiveDecimal(VarDecimal: Decimal): Text[30]GetUoMCode(UoMCode: Code[10]): TextGetVATRegistrationNo(VATRegistrationNo: Text[20]; CountryRegionCode: Code[10]): Text[30]
Plus 131 local procedures.
Triggers
OnRun
Recent changes
- 2026-12-04 #13208 [E-Documents] XRechnung: Events to override buyer, delivery and order reference values (main, BC30, feature)
- 2026-11-16 #14018 [29.X]-ZUGFeRD: Custom Ship-to Address is not transferred to XML Delivery Address in the German version. (releases/29.x, BC29, fix)
- 2026-11-11 #13822 Fix XRechnung export truncating item name to 40 characters (main, BC30, fix)
- 2026-10-29 #12691 Support customer registration number as e-document party identifier for DE (main, BC30, feature)
- 2026-10-06 #9347 Fix IssueDate in E-Documents for Germany (main, BC30, fix)
- 2026-10-02 #8429 E-Document DE: map Payment Method to PEPPOL payment means codes, add SEPA Direct Debit export support (main, BC30, feature)
- 2026-09-29 #9642 [Bug]: E-Documents for Germany - FindEDocumentService always selects last matching service, ignoring which service triggered the export (main, BC30, fix)
- 2026-09-05 #9860 [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130) (main, BC30, fix)
- 2026-08-26 #10631 Integration/main to releases 29.x 31a860b5 (releases/29.x, BC29, feature)
- 2026-08-24 #10349 [DE] Support registration numbers in E-Documents (main, BC30, feature)
- 2026-08-20 #10342 Add GLN information to XRechnung and ZUGFeRD exports (main, BC30, feature)
- 2026-08-12 #10048 Add GTIN to XRechnung and ZUGFeRD exports (main, BC30, feature)
- 2026-08-05 #9955 XRechnung – Invalid XML Generated When Invoice Discount Percentage Exceeds 2 Decimals (main, BC30, fix)
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Electronic invoicing in Germany — possibly related: Exports XRechnung electronic invoices in Germany’s e-document framework. (model-linked)
Deprecations
- procedure FormatFourDecimal: Pending 29.0 (#if not CLEAN29), “FormatFourDecimal is no longer used internally. Quantity and unit price fields are now exported with unlimited precision per EN 16931. For VAT percentages, use FormatFiveDecimal. For quantity and unit price, use FormatDecimalUnlimited.”
- procedure FindEDocumentService: Pending 30.0 (#if not CLEAN30), “The triggering E-Document Service is now provided through SetEDocumentService. This function is still called on every export until CLEAN30: when a service was provided it only raises OnAfterFindEDocumentService without overwriting that service, otherwise it performs the legacy FindLast lookup. As of CLEAN30 this function and that fallback are removed, so any caller that does not provide a service through SetEDocumentService - for example a customized report - then exports with a blank E-Document Service.”
- procedure OnAfterFindEDocumentService: Pending 30.0 (#if not CLEAN30), “The triggering E-Document Service is now provided through SetEDocumentService. This event is STILL raised on every export until CLEAN30 - both when a service was provided and on the legacy FindLast lookup path - so existing subscribers keep working during the deprecation window. It no longer exists as of CLEAN30; move any logic that depends on it to the service provided through SetEDocumentService.”
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). 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: "Export XRechnung Document"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.
A DE country object, not part of W1: the default corpus does not have it; bcatlas_list_countries shows which countries the atlas has.