function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VK86VK86 

Help regarding rollup summary field

Hi all,

 

I want to create a rollup summary field which sums up the amount from its child records.

This summing of amounts should take place only if flag is checked on the child record. Otherwise, the rollup field should ignore this amount field on the child records.

 

Really appreciate any help or idea on how to implement this.

 

Thanks,

VK86

cogcog

This should be possible out of box. Am I missing something?

Create a new Rollup Summary field on the Master object. In Step 3 (Define the summary calculation)

  • Select object to summarize: Select the detail object.
  • Select Roll-Up Type: Sum; Field to Aggregate: Amount
  • Filter Criteria: Only records meeting certain criteria should be included in the calculation. Define the criteria here (checkbox field = true).
VK86VK86

Thanks cog!

zen_njzen_nj

I don't seem to be able to do what is suggested below here.

My requirement is to find any Account entries where there are no related Opportunity entries as well as no related Contacts or Cases.

 

So I can create a custom field in Account called "NumOfOppty" which is a rollup summary field that looks at Opportunity and return a count. Based on that, if the count=0, I know this account doesn't have any associated Opportunities.

 

But when I try to create rollup summary fields for "NumOfContacts" or "NumOfCases", the only lookup object I can choose is just Opportunity, and I can't find Contact or Cases, even though both of these two objects have lookup relationship to Account.

 

So is there a way to do this out of the box (or maybe use formula field instead of rollup summary field) that can accomplish this - essentially a way to identify if an account entry has none of the specific related list entry (whether it be cases, Contacts, or other objects)?

GuyClairboisGuyClairbois

@zen_nj: You will not be able to do that without a (simple) apex trigger. Roll-up summaries currently only work on master-detail relationships. There is no way to check the amount of lookup relationships of a parent record without doing a query.