Using Document Templates in Dynamics 365

Ronelle Raath, 16 May 2019

Why use Document Templates in Dynamics 365?

Having document templates set up can improve document quality across the whole business. It can save time by having a document populated with Dynamics 365 data with just a few clicks as well as ensure a consistent look and feel out to your customers.

I have put together an easy 5 step guide to show you how to create a Word Template within Dynamics 365.

Steps to creating your own Word Template within Dynamics 365

Step One: Downloading a Template
Step Two: Enabling the Word Developer Tab in Microsoft Word
Step Three: Adding Data to a Template
Step Four: Uploading a Template
Step Five: Generating a Template

Step One: Downloading a Template

In Dynamics 365; Navigate to Settings> Templates> Document Templates.
NOTE: You’ll need sufficient permissions to access to the Settings page, such as System Administrator or System Customizer.

image

Select the type of template you would like to create. You have the option of either an Excel or Word Template. Then select the Entity that will be used to populate the Template with data, for this example the Account Entity will be used.

image
Once an entity has been selected you have the option to also select any entity with a relationship to that entity. This will determine what fields are available later when you define the Word template.

Only select the relationships you need to add the Dynamics 365 field data to the Word template. Here are some example relationships for the Account entity:

•    1:N Relationship. An account can have multiple contacts.
•    N:1 Relationship. A lead, account, or contact can have multiple accounts.
•    N:N Relationship. An account can have multiple marketing lists. A marketing list can have multiple accounts.

image

Step Two: Enabling the Word Developer Tab in Microsoft Word

Now that you have the Template you’ll need to ensure you can see and add Dynamics 365 Field/XML data, for this you need to enable the Developer tab within Microsoft Word.

In Microsoft Word; Navigate to File> Options> Customize Ribbon.
Then select the Developer check box:

image

Step Three: Adding Data to a Template

In Microsoft Word; Navigate to the Developer Tab> XML Mapping Pane

image

Then select the Account Template downloaded earlier.

image
This will show all the Fields available on the Account Entity as well as the associated relationship entities selected when creating the Template.

You can select to add these fields to your Template by right clicking the field required, selecting Insert Content Control as Plain Text.

image
Below I have drafted and example with the inserted fields highlighted in yellow:

image
Step Four: Uploading a Template

In Dynamics 365; Navigate to Settings> Templates> Document Templates.

Again, select the type of template you would like to upload. You have the option of either an Excel or Word Template. Then select the Entity that will be used to populate the Template with data, in this case the Account Entity will be used.

image

Now select to upload a template by dragging or browsing for your newly created file.

image

With the draft Document Template created in Dynamics you can edit the Name and Description before saving.

image

Step Five: Generating a Template

In Dynamics 365; Open an Account Record

Within the navigation bar select the Word Templates Tab then select your Template from the Word Template list.

image

This will generate and export a Word Document (Or Excel depending on the Template Type) with the Account Record’s data pulled into the newly created Template.

Below is the result from the example template created earlier. All the inserted fields highlighted in yellow previously now consist of the Dynamics 365 data pulled from the selected Account record.

image

In Conclusion

You can easily unify your business with standardized document by using Word Templates within Dynamics 365. You should definitely give it a try.