Tip #377: Case for a rollup field

¡Hola, amigos! Like if we did not have enough of Spanish at the eXtremeCRM Madrid 2015, we have Pablo “CRMGamified” Peralta in da houz with another spicy tip!

How to setup the new rollup fields to count the number of cases associated with a contract line


In this article I will explain step by step a concrete example of usage of the new rollup fields in CRM 2015, which is to count the number of cases associated with a contract line.

Brief introduction

In Dynamics CRM, we have different types of contract templates depending on their allotment type:
Contracts and allotments

  • Number of cases: entitles the customer to care for x number of cases
  • Time: the customer is entitled to x hours of attention (eg up to 10 hours of support.)
  • Coverage dates: the customer is entitled to unlimited attention given date range.

This is how a contract made with the “Number of cases” template looks like with its lines, including its respective allotments used (in the example, the customer has received attention to 145 cases under that contract line)

The problem with Coverage dates contracts and why the new rollup fields are so useful is…

.. that Allotments Used field remains in 0 (zero), it isn’t updated when allotment type = converage dates.

Therefore, it is an excellent setting where to apply the new rollups fields :), to roll up the total number of cases handled under that contract line.

Let see how to do this.

How to configure a rollup field that counts the number of cases associated with a contract line:

  1. Create new rollup field in Contract Line entity
    New rollup field
  2. Click on “Edit” to set up the rule (at that time if we had not saved it yet, the field is created)
  3. Within the rule, select Case as related entity.Select Case as related entity
  4. We indicate aggregation type, COUNT (“COUNT”):Set aggregation to COUNT
  5. We finished set up our field! :). Save and close.
  6. Now we can add our field to Active contract lines view so we can display the counter in the view of the contract:Add field to Active contract lines view
  7. Save, publish. Check contracts with lines that have associated cases and voila! Our new field is working great!Count field in action
  8. We can also edit the main form for Contract Line entity to include our field:Contract Line entity to include our field
  9. Save and publish the form and we can see our new field working also on the form.

Ohh..and one more thing: the good thing is that this field line works for any contract of any type of contract, regardless of their allotment type :).

I hope you enjoy it and find it has been helpful! :).

Leave a Reply

Your email address will not be published. Required fields are marked *