Insight AX
Back to Featured Insights

How-to integrate custom Microsoft Excel templates into the Dynamics 365 Finance and Operations

16 March 20232 min read
Dynamics 365 Finance & OperationsExcelVisual StudioX++Office IntegrationApplicationSuite model

Another technical guide, I found very useful at some point and just wanted to make a note if it and keeps it here for developers who wish to integrate custom Microsoft Excel templates into the Dynamics 365 Finance and Operations interface.

To make these files accessible within the Open lines in Excel menu, users must first develop a local template and then create a specific registration class using Microsoft Visual Studio.

Essential steps for registering new system templates

To register and promote a new system template so that it appears in the Open in Office and Open lines in Excel menus, you must follow these essential steps:

Create and Save the Template: First, create a Microsoft Excel template and save it to your local machine.

Set Up a Visual Studio Project: In Microsoft Visual Studio, create a new project for a model that includes a reference to the ApplicationSuite model.

Implement the Registration Class: Create a new class that extends DocuTemplateRegistrationBase and implements the LedgerIJournalExcelTemplate interface. This class defines the context for the template, such as the supported journal types and entities. Within this class, you must:

  • Define the resource names for the template and the associated entities (e.g., LedgerJournalHeaderEntity and LedgerJournalLineEntity).
  • Implement methods such as isJournalTypeSupported to specify which journals can use the template.
  • Use the registerTemplates method to add the template details, including its name and description.
  • Specify field names for header and line journal batch numbers and data areas.

Build the Project: Once the code is implemented, build the project or model containing the new resource and class.

Reload System Templates in the Client: Finally, log into the client and navigate to Common > Common > Office integration > Document templates. Select Reload system templates.

After completing these steps, the new template will be visible in the list and will appear on the Open lines in Excel menu for the designated journal pages.

More information can be found the Microsoft Learn sources