This article provides you with a step-by-step tutorial on how to work properly with aggregation.
Aggregated fetches are a useful functionality when creating templates. They allow you to create an overview of certain data and sum or calculate the average of revenues or sales. They can also be used to create quarterly, yearly, monthly or daily reports.
Click here to get a further overview of aggregation in DocumentsCorePack (DCP).
Step 1. Open the Template Designer
Open MS Word, navigate to the www.mscrm-addons.com tab and click on the Insert MailMerge fields button. The DCP Question Dialog opens. Click Yes to open the DCP Template Designer.
Figure 1: Open the Template Designer
Step 2. Open the Configure Fields and Datasource dialog
In the opened Template Designer, select the entity type you would like to work on, such as Account. Then click on the Additional tab and then on the Add Relationship/Entity button.
Figure 2: Resolve a relationship
Step 3. Activate aggregation
In the opened dialog, select a relationship in the drop-down menu. In our example, we selected Account –> Contact [parentcustomerid]. Check the activate aggregation functionality.
Figure 3: Activate aggregation
Step 4. Set the aggregation functionality
In the window that opens, you can set certain aggregation functionalities.
The Attribute drop-down menu enables you to select an attribute field, while the Aggregate/Group by drop-down menu provides you with an overview on which aggregation functionalities can be applied to this field.
Please note: The possible aggregation functionalities depend on the attribute field you select.
Figure 4: Set the aggregation functionality
Click on the OK button to proceed.
Step 5. Insert the newly resolved relationship
Now click somewhere in your template and double-click on the field of the new relationship on the right side.
Figure 5: Insert resolved relationship
As shown in figure 5, the relationship consists of two parts:
- First name → the name of the field.
- (count) → explains the aggregation functionality that has been applied to the relationship.
Now insert your preferred table settings and click on the OK button.
Step 6. The result
We decided to insert a table with a header in our example. The resolved relationship has been added to our template.
Now make sure to save your template. Then merge it with CRM data and test it. If you have not merged and/or tested a template before, please have a look at this article.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to firstname.lastname@example.org.