Friday, November 29, 2013

A Codeless Rollup Field

I owe this tip to my fellow CRM partner-in-crime, Oakton Canberran Julie Stedman who discovered it on a project we are working on. It works for both CRM 2011 and CRM 2013.

The Problem

Often a client asks to roll up the number of child records to a parent record or, perhaps, roll them up and split them by status. An example may be enrolments for a course. On the course record we want to see the number of enrolments and whether the attendees have paid.

Traditionally, we add a field to the parent record and use a plugin to query CRM to populate the value in the field. However, there is another way.

The Solution

A little-known property of adding a sub-grid to a form is the ability to only show a chart instead. This means we can add a bar chart or pie chart to a record showing totals for the child records. Scroll down to the bottom on the sub-grid properties for the magic tickbox to ‘Show Chart Only’.


That is it. With this ticked, instead of a grid showing, you see a chart which represents whatever related data you desire. Here is an example where I have added the chart to a Case record to summarise the associated activities.


The only drawback with this is you cannot drill down into the chart but, for rollup totals, this is probably not the end of the world.


For a quick and elegant way to show rollup totals of child records on a parent record, consider this trick. You still have the power to configure the look and feel of the chart(s) and you avoid adding a bunch of fields and populating them via plugins which can be time-consuming and, therefore expensive.

No comments: