Create and Upload word templates in Dynamics 365
To create word template Go to Settings -> Templates, then click “New” ribbon button. Now select word template option, select an entity by using drop-down “Filter by entity”.
Now, you will see another popup with related entities options which you can use in word template to get data from these entities and write in the word document.
Now, click “Download Template” button as you can see in above screenshot. Open the document, it will be blank by default.
In order to use Dynamics 365 XML data, you need to enable the Word Developer tab. Go to File -> Options -> Customize Ribbon, and then enable Developer and Press “OK”.
To avoid word freezing when you insert CRM fields, do the following
Open File-> Options then follow these steps. Uncheck the check-boxes as highlighted by tool-tips as 3 and 4.
Now select the Dynamics 365 schema as shown in this screen
Under XML mapping panel if you cannot see CRM entity then do this
And expand it again you will see CRM entity. At this point document is blank.
To add dynamic CRM fields in word template, click inside blank document which we created in previous steps. Then from XML mapping panel, right click on entity field, click Insert Content Control -> Plain text.
And the field is placed in file like this. Save the file.
If you want to include related records in the form of list in the word file, then insert a table in the same word file, give caption of columns and then insert fields in each column from XML Mapping panel. Then select the entire row which contains these CRM fields. Now, right click the relationship from XML mapping panel and then select “Repeating”
Final template document looks like this
Now, go to Settings -> Templates -> Document Templates. Click upload button
Click “browse” link and then “Upload” as shown in next screen
After template uploaded successfully, you will see this screen
Now open any customer record for which you have created template, you will find the uploaded template here.
References: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/admin/using-word-templates-dynamics-365
This was originally posted here.
*This post is locked for comments