15 Jan’16

Dynamics CRMDocument Generation in Dynamics CRM 2016

In this article, we will review the new and improved out-of-the-box capabilities to generate documents that contain data from CRM records. Users can now create Word and Excel templates for letters, agreements, quotes, invoices and other, in just a single click!

Out of the box Templates

Out of the box, here are the templates Microsoft includes with the CRM 2016 release

Figure 1.0 1
To run the Template you’ll first need to select the appropriate record. For the Account Summary Template, select an Account record and select it from the Action menu. As shown in Figure 2.0 1.

Figure 2.0 1
Account (Cloudfronts Technologies LLP) Summary template is generated.

Figure 3.0 1
Open the Account Summary.docx file.

Figure 4.0 1

Create a new Excel Template

Go to Settings – Templates – Document Templates. Click on +New to launch the wizard.

Here you can select either Excel or Word templates, the entity and the View. The Edit Columns link provides users a quick way to add columns to the template similar to that of an Advance Find. CRM knows where to display the template file based on the entity selection.

If you already have a template, choose Upload, otherwise choose Download to see what CRM created as the Template based on your field selections.

Figure 5.0 1
To upload a file we need to just drag & drop in the box and click the upload button

Figure 6.0 1
Once the upload is complete, the template record is displayed.

Figure 7.0 1
Once you have selected the Template, you also have the ability to set the security roles and control.

Figure 8.0 1

Create a Word Template

Go to Settings – Templates – Document Templates and click +New. Choose the Word Template, select the entity and press Select Entity button.

Figure 9.0 1
A wizard form opens to provide options in navigating across various entities depending on the relationship types.

Figure 10.0 1
The relationships you select on this screen determine what entities and fields are available later when you define the Word template. Only select relationships you need to add CRM data to the Word template.

Click Download Template on the Select Entity page to create a Word file on your local computer with the exported entity included as XML data.

Enable the Developer Tab

Open the Word template file. At this point, the document appears to be blank.

Figure 11.0 1
For To see and add CRM XML data, you need to enable the Word Developer tab.

Go to File > Options > Customize Ribbon, and then enable Developer.

Figure 12.0 1
Developer now appears in the Word ribbon.

Figure 13.0 1
You use the XML Mapping Pane to add CRM entity fields to your Word template. Be sure to only add fields as Plain Text or Picture.

Figure 14.0 1

Define the Word template

Use the XML Mapping Pane to define the Word template with CRM entity fields.

  1. In your Word template, click Developer > XML Mapping Pane

    Figure 15.0 1
    The default XML schema is selected.

  2. Select the CRM XML schema. It will begin with “urn:microsoft-crm/document-template/”.

    Figure 16.0 1

  3. Expand the CRM entity, right-click the entity field, and then clickInsert Content Control > Plain Text.

    Figure 17.0 1
    The CRM entity field is added to the Word template. Add additional entity fields, add descriptive labels and text, and format the document.

    A completed template might look like this:

    Figure 18.0 1
    Some content control fields you entered likely have multiple lines of data. For example, accounts have more than one contact. To include all the data in your Word template, set the content control field to repeat.

    Set content control fields to repeat

    1. Put fields with repeating data in a table row.
    2. Select the entire table row in the template.
    3. In the XML Mapping Pane, right-click the relationship containing the content control fields, and then click.

      Figure 19.0 1
      When you use the Word template in CRM to create a document, the table will populate with multiple rows of data.

      When the template has the fields and formatting you want, save it and upload it into CRM.


Upload the Word template back into CRM

When you have your Word template built the way you want, save it so you can upload it into CRM.

To use the Word template you’ve created, do the following:

  1. Open a record with information you want to create a document. For example, open a customer account record in Sales.
  2. ClickMore (> Word Templates, and then under Word Templates select the template you created.

    Once generated, documents can be downloaded and then printed, shared, emailed or collaborated on with Microsoft Office 365


Written by

Team Member


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more