Word templates are not the most flexible templating solution for Dynamics 365 but for the simplistic scenarios it does work well, and is quite fast.
Built-in templates are used to be notoriously difficult to modify. Not anymore, thanks to the Document Template Manager from Jim Novak. Now that we can modify the content itself, how about refreshing the data source, e.g. when new fields were added to the entity? Good news is that it’s possible without the need to recreate the template:
- Download the template using XrmToolbox
- Change file extension from docx to zip. Yes, Word file in the new format is a zip file under the hood.
- Open zip using Explorer, and extract the customXml\item1.xml file.
- Open item1.xml using your favorite editor.
- Insert new fields at the beginning (or wherever) using the format <field_name>field_name</field_name>. In fact, element name can be anything, it’s only used to show the element in the list:
- Add the fields as required:
- Replace file in the archive (copy in Explorer, open zip file, navigate to customXml folder, paste, say yes to replace).
- Rename file back from zip to docx.
- Use XrmToolbox to upload the template back, replacing the existing one.
- And enjoy the results