CRM Custom hierarchies are very useful feature for maintaining hierarchy among records and also provide nice visualization of the Hierarchies.
Learn more about hierarchies here: http://www.powerobjects.com/.015/03/30/microsoft-dynamics-crm-2015-custom-hierarchies/
With rollup fields and custom hierarchies have become even more useful to derive and visualize meaningful data in the hierarchy. In this blog, we will use how to leverage Rollup fields and Custom hierarchies to get proper data and avoid redundancy and custom calculations.
Suppose you have a custom hierarchy of campaign, so a campaign can have multiple child campaigns. Each campaign has leads associated to it.
The requirement is to get the count of all the leads of the related child campaigns and also itself.
If you want count of leads on the campaign, we can easily create a rollup field on Campaign to get the count of leads on Campaign. The rollup field will look like below:
You can see the count of leads using the above rollup below on the campaign form:
Get total lead count of child campaigns on Parent Campaign
With rollup using hierarchy, we can get this done without any calculations. See below the rollup definition for this. Note that we have now enabled “Use Hierarchy” in the rollup definition.
This will get us the count of all leads including Child campaign as well.
See the form now with the updated rollup definition, the lead count is now “8” which is the sum of lead count of all child campaigns
Leveraging Calculated fields, rollup fields and custom hierarchies we can easily build good and simple solutions, avoid custom calculations and redundant fields.