-
Notifications
You must be signed in to change notification settings - Fork 358
Description
Describe the issue
When exporting the file associated with an E-Document Log entry, it is always exported with an .xml extension because of the following piece of code:
namespace Microsoft.eServices.EDocument.IO.Peppol;
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)
begin
FileName += '.xml';
end;
...
}
This behavior breaks the file export function for third-party integrations where the imported data is structured in formats other than xml.
Expected behavior
The specified event subscriber should only append the default file extension (.xml) when
- Document Format of the E-Document Log entry is PEPPOL BIS 3.0
- An extension has not yet been appended to the
FileName.
Steps to reproduce
- Set up a new E-Document Service with the following parameters:
- Document Format: any other than PEPPOL BIS 3.0
- Service Integration: none
- On the E-Documents page use the New from file action to upload any valid
jsonfile. - On the card of the new E-Document navigate to Related / Logs.
- On the E-Document Logs list select the first log entry, which should have the Imported E-Document Status.
- Use the Export File action to download the associated content.
- The exported file content is
jsonbut the file extension is.xml.
Additional context
This approach in general is not ideal as the file extension should be provided by the IEDocFileFormat implementation of an E-Doc. Data Storage entry that is being exported, not by event subsribers in E-Document apps. But unfortunatelly, File Format is not always specified on the Data Storage entry (actually, it is always Unspecified for the "Batch Imported" E-Document Log Entries).
So the suggested change would at least make it possible for specific Document Format/Service Integration implementations to decide the file extension on their own E-Document Log entries.
I will provide a fix for a bug
- I will provide a fix for a bug