Wed, 05/12/2021 - 14:54 By Fabian Kalchofner Reviewed By Lloyd Sebag
2 comments

Dynamics 365 Word Template update metadata

We all know this, we created a new Word template and it looks good. But then, we have a newly created attribute, which needs to be displayed in the existing Word template. Instead of creating a new one and copy all from the old template, I'll show you, how you can update the existing Word template.

Basically, the Word templated (e.g. AccountDetails.docx) is a zipped folder. So you can rename the file to AccountDetails.zip and extract the zip.

Dynamics 365 Word Template update metadata

In the subfolder "customXML" you'll find a file named "item.xml". Open this file with your favorite text editor and you'll see the following:

item.xml

Now you can simple add a node with the logical name of the attribute. This will also work for related entities found in the xml file.

Dynamics 365 Word Template update metadata

Once done, zip the files in the folder AccountDetails and rename the zip file to AccountDetails.docx. You'll see the newly added field in the XML Mapping Pane in Word:

XML Mapping Pane

If you use a tool like 7zip, you can directly open the .docx file without renaming it to .zip and replace the existing item.xml:

7zip

Dynamics 365 Word Template update metadata

Comments

Hi, is there a way to order or filter 1:N relationships? or would you suggest an alternative way?

Tue, 03/29/2022 - 09:27
Luca (not verified)

Hi Luca

Actually and unfortunately, you can't sort or filter relationships in Word templates. The ordering is based on the creation date.

As an alternative, you could try to use some third party applications. Or another option would be to create an Excel template, where you can sort and filter the results.

Wed, 03/30/2022 - 09:52

In reply to by Luca (not verified)

Add new comment

Image CAPTCHA
Enter the characters shown in the image.