Skip to content

[Bug]: E-Document - E-Document Log Data Storage content is always exported as an .xml file #7200

@georgepomazkov

Description

@georgepomazkov

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

  1. Set up a new E-Document Service with the following parameters:
    • Document Format: any other than PEPPOL BIS 3.0
    • Service Integration: none
  2. On the E-Documents page use the New from file action to upload any valid json file.
  3. On the card of the new E-Document navigate to Related / Logs.
  4. On the E-Document Logs list select the first log entry, which should have the Imported E-Document Status.
  5. Use the Export File action to download the associated content.
  6. The exported file content is json but 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    IntegrationGitHub request for Integration area

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions