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

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more