• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/Create One-Click-Actions and Templates for ZUGFeRD/Factur-X Invoices

Create One-Click-Actions and Templates for ZUGFeRD/Factur-X Invoices

1094 views 0 Updated on March 13, 2025

ZUGFeRD and Factur-X are hybrid e-invoicing formats used primarily in Germany and France. They follow the Cross Industry Invoice (CII) standard, which the United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT) specifies. They combine a PDF/A-3 file with embedded XML data, meaning the invoice is both human-readable (PDF) and machine-readable (XML) within the same document.

DocumentsCorePack allows for the creation of documents that comply with these formats through the use of One-Click-Actions. This article will demonstrate exactly how to generate such documents. At the end, you will find working samples under Attached Files to quickly try it out yourself.

Prerequisites:

  • DocumentsCorePack Server: Version 2024.4 or higher (learn how to update here)

Creating the OCA

To generate a ZUGFeRD/Factur-X-compliant invoice document, we will need to configure a One-Click-Action (OCA) for our Invoice entity. You can create this OCA as usual, but be sure to set the Template Selection to ZUGFeRD (Multipart) under Template Settings.

Note: You can create an OCA for any table in your system, not just invoices, using this functionality. Additionally, while our sample focuses on invoices, you can just as easily apply it to credit notes, debit notes, order confirmations, and other scenarios.

Tip: You can automate OCAs like this using Microsoft Flows with our DocumentsCorePack connector. Find more information here.

Selecting the ZUGFeRD option
Figure 1: Selecting the ZUGFeRD option

Differences to regular OCAs

Selecting this setting will open a Multipart that has two parts: “ZUGFeRD pdf” and “ZUGFeRD xml.” For each of these parts, you have to select a template. In the “pdf” row, select a ❶ template that will display the visual contents of the document as a PDF. In the “xml” row, select a ❷ template to embed as an XML file in the resulting PDF.

Note: If you do not know how to create an XML template, please see here.

The ZUGFeRD Multipart.  Two templates have to be selected.
Figure 2: The ZUGFeRD Multipart. Two templates have to be selected.

You can easily add additional, optional parts to the Multipart, which will concatenate with the resulting PDF. This can be handy when adding cover pages or terms and conditions, for instance. The default concatenation options are available.

Adding other parts to the Multipart
Figure 3: Adding other parts to the Multipart

After you select the templates, you can configure the rest of the OCA. Do note, however, that the file type for this specific type of OCA is locked to PDF and cannot be changed. Additionally, if you want to send a document directly to a recipient, you will need to set the Attach document option to email attachment.

The processing settings window.  Note that the file type option is locked and grayed out.
Figure 4: The processing settings window. Note that the file type option is locked and grayed out.

Furthermore, you cannot edit the selected templates (as modifications could cause the visual to misalign with the XML), and the DocumentsCorePack Dialog cannot create a PNG preview of the generated document.

The image preview and edit document settings are unable to be selected when ZUGFeRD is enabled
Figure 5: The image preview and edit document settings are unable to be selected when ZUGFeRD is enabled

Save the OCA after you have finished setting it up. Then, navigate to the Create Document button to run your OCA.

Running the OCA

Select your newly created OCA in the Create Document dialog. Whether you’re using the Template Designer or the Create Document dialog, you can individually test components like the PDF or XML as usual. However, to generate a PDF with the embedded XML, you must always use an OCA.

Create Document Dialgo
Figure 6: Create Document Dialog

Although DocumentsCorePack does not verify a ZUGFeRD/Factur-X document against a specific schema, it does check whether the XML file is valid. If the file is invalid, you will receive an error message, and the process will halt to prevent the creation or sending of invalid files.

error message xml
Figure 7: Error message for invalid XML

When you download and open the generated PDF, you will see the XML file in the PDF’s attachments.

Note: Ensure that the PDF viewer you choose is capable of this before opening your PDFs, because not all PDF viewers (such as web browsers) can view PDF attachments.

The generated PDF with the attached XML on the right
Figure 8: The generated PDF with the attached XML on the right

If you’re using your template for e-invoicing in a specific standard, use an online validation tool to check compliance. To ensure your template meets the required standards, start by adjusting it based on any issues found during conformity checks. This way, you can maintain compliance and avoid potential errors in your e-invoicing process.

Try it yourself!

For your convenience, we have provided two templates under Attached Files beneath the article: a template to generate a PDF (“Invoice sample for OCA”) and a template to generate an XML file to attach to the PDF (“InvoiceTemplate-xml-CII_D16B”). You can use these files to test this feature in your own environment.

Please note that these files are just examples meant to demonstrate how the basic technique works. We have tried to adhere to the described standard, and the fields used refer to standard Dynamics systems.

That’s it! We appreciate your feedback on ZUGFeRD and Factur-X for DocumentsCorePack! Please share your thoughts by sending an email to support@mscrm-addons.com.

Tags:ZUGFeRDFactur-XxmlOCAone click actionCIICross Industry Standarde-invoicinginvoice
Attached Files
#
File Type
File Size
Download
1 .docx 414.62 KB Invoice sample for OCA
2 .docx 61.73 KB InvoiceTemplate-xml-CII_D16B

Was this helpful?

Yes  No
Related Articles
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Configure DocumentsCorePack within custom pages
  • Ensuring correct time zone display for DateTime fields
  • Document Generation Failure from Missing Privileges
  • Building Custom XML for Multipart documents
Latest Articles
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Recap: ColorCloud 2025
  • Configure DocumentsCorePack within custom pages
  • AI-Powered Document Generation with Copilot in Sales
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How licenses are counted
  • How to insert Condition Fields in DocumentsCorePack Templates designer
Categories
  • *News and General Infos* 62
  • Webinars 44
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 250
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 72
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.