Dynamics 365 – Word Template Recursive Tables

Dynamics 365 – Word Template Recursive Tables

Proposals, quotes, orders and invoices are common requirements of today’s business. In the past, custom report writing using SSRS and FetchXML was required to print these kinds of documents in full detail. Often a specialist was hired to build those reports and to customize them with logos and company branding. Luckily, since the launch of Dynamics 2016, we have access to a feature which uses a mail merge like process with Word templates to create reports with related record tables.

This document will show you how to use this feature and assumes you already know how to generate a document template.

Adding the One-to-Many Relationships
We will use a proposal generated from opportunities as an example. To do this we need a document template and the Opportunity products one-to-many relationship.
MS CRM document template

 

 

Adding a Table to the Word Template
The first step is to take your basic template and add a table element. Then add a repeating control to the table row.

Since the products need a header, insert a 4x2 table into the repeating control area shown below and add the column headers.
MS CRM template text
MS CRM template text

Insert a Repeating Content Control
Next a repeating content control will need to be added to the second row of the table. To do this select the whole second row in the table.
MS CRM Content Control

Insert the Opportunity Products Repeating Control
We can do this by expanding opportunities in the XML pane and right clicking the opportunity products (product_opportunities) and choose Insert Content Control -> Repeating.
MS CRM repeating control

This will add the control to the table.
MS CRM Control Table

Insert the Opportunity Product fields
Now that the repeating control is added, the fields should be added to it as text fields only.
MS CRM opp product fields

Finish with Formatting
Formatting can now be included to show company branding and make the template more visually appealing.
MS CRM formatting

Upload the Template
Now is the time to upload the template and view the results.
MS CRM Upload template

If you need help with Word template recursive tables or any other element of your CRM, we are here to serve. We have been helping clients across the country and around the world for nineteen years, so we’ve acquired decades of expertise. Don’t struggle with an issue when help is only a phone call away. Give us a call at 1-800-880-1960 or email info@toplineresults.com for assistance.

About the Author
Chuck Wojciuk is a CRM Engineer for TopLine Results. Chuck specializes in developing CRM databases for clients and supporting Microsoft Dynamics 365.


Leave a comment!

You must be logged in to post a comment.