This article describes how to build sums of line items witin a table using the Mark as Sum-Field-option.
In the following example, a quote is created with two different groups of products. For each group, a sum should be displayed in the grouping footer.
Please note:
- If you need more information on creating relationships using the DocumentsCorePack (DCP) TemplateDesigner, have a look at this article.
- For details on how to create a grouped table see this article.
Step-by-step description
Step 1: Start by opening the DocumentsCorePack template and navigate to the table where you want to define a sum over a set of line items.
We want the sum to appear in the footer of a table.
![Table which should show the sum in the footer](https://cdn.mscrm-addons.com/wp-content/uploads/2022/01/2023-02-20_10h49_35-300x283.jpg)
Step 2: ❶ Copy the field that should be ❷ summed up into the footer. In our example, we are using the <<extendedamount>> field from the last column of the table.
Please note: If a footer row is needed, add it via the Edit table options in the mscrm-addons.com ribbon.
![Sum up a field in the footer](https://cdn.mscrm-addons.com/wp-content/uploads/2022/01/2023-02-20_12h41_50-300x242.jpg)
Step 3: Next step is to place the ❶ cursor on the field, where you want the sum to appear. In the drop-down of the Grouping, options select ❷ Mark as Sum-Field.
![Mark fields as sum fields](https://cdn.mscrm-addons.com/wp-content/uploads/2022/01/2023-02-20_12h21_34-300x186.jpg)
Step 4: To publish it to Dynamics 365 use the [Save Template]-button. If you want to test it, follow this link for helpful information.
Step 5: This result template shows a wonderful insight into the Mark as Sum-Field feature:
❶ The product group Recurring Subscriptions with the products ActivityTools and DocumentsCorePack and ❷ the sum of the group about the two product items.
❸ Then the group Service, including a workshop and a configuration setup, with the ❹ corresponding sum of the service items and the ❺ total amount of both groups.
![Result template showing grouping](https://cdn.mscrm-addons.com/wp-content/uploads/2022/01/2023-02-20_14h54_12-226x300.jpg)
That´s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.