This blog article outlines how to sort data in DocumentsCorePack templates by using the Relationship Designer.This tool allows you to sort your data individually.
1) First of all, open Microsoft Word and navigate to www.mscrm-addons.com. Next click on the [Insert MailMerge Fields]-button and prepare the data you want to sort, e.g. like in the example below.
2) Next, navigate to the right side and select ❶ Additional. Then select the data table you want to sort – in this case, ❷ Contact (table1) and click on the ❸ [Edit]-button.
3) In the so opened window, also called Relationship Designer, you can define how you want to sort your data. To do so, you first have to choose the ❶ Attribute and then the ❷ order you want to sort your data. In this example, we want to sort our data after the First Name Ascending, like you can see below. If you have more than one sorting Attribute, you can specify which should be first executed by setting a ❸ priority.
Please note: This function will sort you all records before these will be merged. After saving your template and merged it with Dynamics 365 data, the table should look like below.
It is also possible to sort grouped tables. For more information about how to group tables in DCP .docx templates, please have a look at this blog article.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.