D365FO e-Invoice as XML with embedded PDF, with and without Docentric

This forum post describes the 2-step process of creating XML e-Invoice with embedded PDF in standard D365FO, how Docentric combines with it today, and how Docentric plans to further improve this process.

1. How standard D365FO handles e-Invoices?

Generating the XML output file with embedded PDF is a 2-step process:

  • Step 1: objective is to generate a PDF and attach it to invoice journal. There are different ways how to achieve this, for example:
    • With standard: if everything for e-Invoicing is correctly configured, posting and printing the invoice to any print destination (even Screen) will automatically create a PDF and attach it to invoice journal header.
    • With Docentric: you can alternatively use Docentric File print destination > Save as attachment > Journal to get a better control of the output file name, type, attachment document type etc.
  • Step 2: generate and send e-Invoice by clicking the Document > Send button on the posted invoice journal. If the Customer is correctly configured and correct ER configurations are present, this will trigger the following:
    • Generation of XML file based on the configured ER configuration.
    • Embedding the PDF file from Step 1 into the generated XML. If PDF attachment doesn’t exist at this time, XML won’t contain any attachments.
    • Distribution of the generated XML to the configured ER destination.

2. How are Docentric additional attachments (“generate from” rules) combined with this process?

This option also requires a 2-step process as in the first option above:

  • Step 1: this is identical to the first step above.
  • Step 2: this step is different. Instead of using the Document > Send button to trigger the standard D365FO engine for generating and distributing the XML, you use Document > View > Use print management. In the relevant Print management, you previously configure one of the Docentric print destinations with Additional attachments, using the “generate from” rule and selecting the previously installed ER format configuration you need (e.g., UBL, PEPPOL, ZUGFeRD etc.). This will:
    • Generate the main report document.
    • Generate the additional attachment document – XML in the scenario we are describing. This is based on the standard code, so if the PDF from Step 1 is found as an attachment on invoice journal header, it is embedded in this XML, otherwise XML is generated without this PDF attachment.
    • Based on the Print as setting on the additional attachment, these 2 documents are delivered as 2 separate files, or XML is embedded into the main document (if it is PDF). If the method of delivery is email (Docentric Email print destination), you can turn on the Email without report flag, to remove the first (main) document and email only the XML

3. How Docentric plans to further improve this process?

In one of the future releases, planned for the end of this year, we will support executing the ER formats as main report. Today, on any Docentric print destination in the template lookup you can select any applicable Docentric template, but also @SSRS_BUILTIN_DESIGN@, to generate the main report based on the SSRS format. Here we will offer also related ER formats.

So, the setup could be the following:

  • Select ER format in the Docentric template lookup. It will generate the main XML document.
  • Configure additional attachment, Generate from = Docentric report template, Target output format = PDF, Print as = new option that will be introduced, “XML attachment”.

With such setup, this will finally become a one-step post & print process :star_struck: