Promising New Feature: Word Templates

One new feature that looks promising for the CRM 2016 release is the addition of Document Templates.  This feature allows generation of Microsoft Word and Excel documents based on Office document templates.  I was particularly interested in using Word templates as a method for printing CRM records because of the standard browser based printing issues.  We have also had several recent customer requirements around printing mass mail documents.  Looking at the following release and help documentation at the following link, things looked promising: Using Word templates in CRM.

Unfortunately, once I began testing out the features, I ran into several issues and limitations.

Crash!

Once you follow the instructions in the Customer Center article and download the Word template that contains the selected schema, Word crashed… a LOT!   It seemed like even the simplest tasks would cause Word to hang then ultimately crash.

I wanted to show a Word template with Account details and the list of related Contacts, just as the sample in the article.  So I created the template for the account entity, following the instructions in the Customer Center article listed above.  I am using Office 2016 and an online instance of CRM 2016 for my testing.

Word Template, select Account Entity

Word Template, select Account Entity Relations

When I insert the first field for name and hit Enter, Word will auto capitalize the field and then just hang up.  So, this is actually mentioned as part of the article:

Warning

A few things can cause Word to freeze, requiring you to use Task Manager to stop Word:

  • You insert a content control other than Picture or Plain Text.
  • You make a textual change, such as changing the capitalization or adding text, to a content control. These changes can occur through AutoCorrect as well as user edits. By default, Microsoft Word AutoCorrect capitalizes sentences. When you add a content control field, Word sees it as a new sentence and will capitalize it when focus shifts away from the field.

This is a good notice but it does not tell us whether this is caused by issues in Word or issues with the content provided by CRM.  In addition to this crash, I had seen Word hang and crash when attempting to work with the Repeating data, such as selecting the control for adding another row.  Harder to reproduce, but still frustrating.

My assumption is these are issues with CRM generated information vs. issues with Word but with either answer, it seems like a pretty big issue as part of a release!  You either need to turn off AutoCorrect or be very careful during your work.

Personal Template Management?

One annoying bit about this new feature is finding my list of existing Personal Document Templates.  The templates will be listed when you want to use them on a record, but I could not find a simple way to view my current list of Personal Document Templates that I had created.  I had to navigate to the Settings -> Templates area and view My Templates, or do an Advanced Find for Personal Document Templates to see the list.  The reason I even ran into this was because I had issues with updating my document template and duplicate document template records.

After initially uploading the document template, I wanted to update a few things, such as adding a new field to the output or formatting some text.  I assumed that I could just re-upload my document template and CRM match using the document name since it was used in the initial upload.  Instead, CRM will create a new template with with the same name:

Word Templates, Duplicate Names!

This was especially confusing because I had not refreshed my browser and I was only seeing the initial list when I was attempting to generate the Word document from the record.  So I ran my Advanced Find, opened my original record, but at this point, I still have no method for updating an existing template.  It seems that the only way to update is to either deactivate or delete the old records and upload the new Document template. I could be missing the method for update on the web client because the SDK does list an UpdateRequest message in the documentation: PersonalDocumentTemplate entity messages and methods.

Bulk Execution… or not.

One big limitation for this release is the ability to generate Word documents for multiple records at one time.  I understand that this would not be a simple feature to implement:  would this add too much load on the system, how would we capture the generated documents, how do we handle failures, etc.  That said, I envision Office Document Templates offering an alternative to custom SSRS reports or using standard Mail Merge for for bulk mailing in CRM.  Some possibilities for bulk output could be to a combined zip file for download, redirect to a SharePoint location for later download, etc.  These options would largely depend on the number of records, the complexity of the template and the volume of expected output.  Not a simple problem, but definitely something that can be done!  Seeing that the SDK offers specifics on managing Document Templates, I am hoping that a later release may offer some additional methods for executing the templates programmatically.

As always, comments are welcome.  Please let us know what you think of this new feature and offer any corrections or suggestions for this post.

Update on Bulk Execution

So… an update on this limitation!  Thanks to a new feature review by Mitch Miliam (http://www.xrmcoaches.com), I found out that you can create the Word Template from a workflow.  I really can’t find any documentation on it but I was able to test it.  On a workflow, you can select a Perform Action step and choose SetWordTemplate:

Perform Action Settings

From Set Properties, you can choose from available templates and the record to which this will be applied:

Set Word Template Properties

So, what happens with this Action?  The Word Template will be applied and the generated document will be attached to the Account as a note attachment.  Unfortunately, I cannot find details on this in the documentation on MSDN as to that Action.  Thanks to @XperiDo ( https://twitter.com/XperiDo ) on twitter for the tip on the output of the Action.

You can run this workflow on a single record or multiple records and it seems to work fine. But with running multiple records, I would be very careful about the volume and impact on system performance.

So it’s nice to see that you can execute the template programmatically but it still seems like there is more work to be done on this feature!

Next Up…

In a following post, we will discuss the capabilities of the Excel Document Templates, released alongside Word Document Templates.  This feature seems to target data analysis vs. formatting data for output and provides some powerful end user tools for digging into their CRM data.