From 912e03930889964ef220cc697770acd2ca3dbbb5 Mon Sep 17 00:00:00 2001 From: Jeffrey Bulanadi Date: Thu, 30 Apr 2026 17:08:08 +0800 Subject: [PATCH] EDocument: scope PEPPOL BIS 3.0 .xml extension to correct document format The SetFileExt event subscriber in EDocImportPEPPOLBIS30.Codeunit.al unconditionally appended '.xml' to every E-Document Log export, regardless of the Document Format. This caused third-party integrations using a non-PEPPOL format (e.g., json, csv) to receive their exported files with an incorrect .xml extension. The subscriber now: - Only appends '.xml' when the E-Document Log entry has Document Format set to 'PEPPOL BIS 3.0' - Only appends '.xml' when the FileName has no extension already set, so that other subscribers or implementations can override it first No changes to behavior for PEPPOL BIS 3.0 documents when no extension has been set by another subscriber. Closes #7200 --- .../App/src/Format/EDocImportPEPPOLBIS30.Codeunit.al | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apps/W1/EDocument/App/src/Format/EDocImportPEPPOLBIS30.Codeunit.al b/src/Apps/W1/EDocument/App/src/Format/EDocImportPEPPOLBIS30.Codeunit.al index 2a8b1d98f1..8c46281b65 100644 --- a/src/Apps/W1/EDocument/App/src/Format/EDocImportPEPPOLBIS30.Codeunit.al +++ b/src/Apps/W1/EDocument/App/src/Format/EDocImportPEPPOLBIS30.Codeunit.al @@ -611,7 +611,13 @@ codeunit 6166 "EDoc Import PEPPOL BIS 3.0" [EventSubscriber(ObjectType::Table, Database::"E-Document Log", 'OnBeforeExportDataStorage', '', false, false)] local procedure SetFileExt(EDocumentLog: Record "E-Document Log"; var FileName: Text) + var + FileManagement: Codeunit "File Management"; begin + if EDocumentLog."Document Format" <> Enum::"E-Document Format"::"PEPPOL BIS 3.0" then + exit; + if FileManagement.GetExtension(FileName) <> '' then + exit; FileName += '.xml'; end;