Count the number of related child records using a Rollup field

3 comments

Its going to be a very simple and basic blog where i will show you how you can count number of related records for e.g.

  1. number of cases related to account/contact
  2. number of opportunities related to account/contact
  3. number of active quotes for a contact

this list can go one. In short wherever you have 1:N relationship ; you should be able to perform this operation. it will show something like below :

1

 

  1. To do this create a field on parent record – select the name and select the data type as “whole number” and  field type as “RollUp”  :2
  2. after doing this as soon as you click on “edit” – it saves the field and give you an editor , just like a business rule select the cases(customer) as a related entity.
  3. you can define condition below that for e.g where status of the case  = active or where cases owner is a particular user.
  4. finally in the Aggregation select “COUNT” and in the next field it will show you just one option as case.
    3
  5. finally save the editor and put this field on the form. When you open the form after the publishing all customization , you might see this as 0 at first place its because rollup fields are nothing but system jobs in the background which runs at particular time ( 12 hours to be specific) but you can always force it by clicking to that refresh button in the field :
    5

once all done you will have this field showing you the related records count.

 

i hope this helps!

Advertisements

3 comments on “Count the number of related child records using a Rollup field”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.