Pretty cool, but…

A relatively new feature with Dynamics CRM is the ability to define Word and Excel Document Templates.  I had written a post about the new feature while working at Celedon Partners that you can read at Document Templates in CRM 2016. A customer is using this new feature heavily in their current solution, so I’ve had the opportunity to gain more practical experience with the feature. It’s a pretty powerful tool as a first release but it is definitely not complete. Two issues that I feel cause a bit of frustration: you cannot download the Word or Excel Document Template file associated with the Document Template record, nor can you update the contents with a new Word or Excel document, once uploaded.

For example, you upload and create a new Word Document template, do some testing, and then decide you need to make content or layout updates based on user feedback. You make your updates to the Word Document and then attempt to re-upload into the system. Unfortunately, uploading the updated Word Document template simply creates a new Document Template record with the same name.  To update the Word Document Template contents, you will need to delete your old Document Template record and upload a new one.  This doesn’t sound like an enormous issue, but my customer is also leveraging the ability to invoke the Document Template via a CRM Workflow step.  So for every change we make to the Document Template, it means additional steps to update all related workflow references to the Document Template since the old template as just deleted!

Also, as mentioned, you can’t download the content of the current Document Template record. Following best practices for source code control means that you should not need to worry about losing your source Word and Excel documents, but what happens the only source is your CRM instance?  This should not happen if we are managing our source properly, but as we all know, this is not out of the realm of possibility.  A more likely situation is that I simply want to use one of the existing Document Templates that ship with the Dynamics CRM solution as a starting point for a template. No matter the situation, it seems like a simple feature that was not included with the initial release.

Before I continue, I admit that I may just be missing how to download and update document template content and these features may exist in CRM.  If so, please drop me a note and let me know how to perform these steps!  Until then, I’ve decided to create a small plugin for the XrmToolbox that allows you to download one or more of your System Document Templates and update the Content of an existing Document Template.

Document Template Manager Plugin

This is a pretty simple tool, a plugin that allows you to download your Document Templates and update the Content portion of an existing Document Template.

Document Template Manager Main Screen

Currently, it only allows you to work against System Document Templates, not your Personal Document Templates.  I hope to be adding that feature in a later release. You can load the list of existing System Document Templates.  Once loaded, you can select an item to view its details in the properties grid to the right.

To download your templates, select one or more of the items in the list and select Download Template(s) and you will be prompted for a folder into which your templates will be saved.  If a single item is selected, the file will be downloaded with the name of the Document Template.  For example, selecting the “Case Summary” Microsoft Word Document Template, the file saved as “Case Summary.docx”.  If more than one document is selected in the list, your Document Templates will be saved in a Zip archive.  For example, your Zip archive will be named similar to the following: “Document Templates – 5-2-2017 19-24.zip”

In order to update your Document Template contents, select a single item from the list and choose Upload Template.  Here, you just need to be sure the correct document is uploaded as a replacement.  For example, you should not attempt to overwrite a Microsoft Word Document Template definition with an Excel document.  I have actually not tested what would happen in this situation but I assume that it would not be good! Once the document template has been updated, it should be available for use immediately.

That’s about all there is to it for the tool… for now.  I have a few tweaks that I would like to make, such as working with Personal Document Templates, editing template attributes like name and description, adding a new template via upload, etc. I will post a note as I provide significant releases.

In the meantime, you can download the plugin via the XrmToolbox Plugin store.  Just search for Document Template Manager.

As always, feedback is welcome, including comments, suggestions, or bug reports!