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
aqkraftaqkraft 

Counting Related List Items

I have been asked by sales to create a field on an Account that counts all the opportunities associated with that Account. They wish to use this in various reports, among other things.

 

For example, if an Account has 4 Opportunities in its Opportunities Related List, this field would have the number "4" in it. And "0" if there are none.

 

I have been told I can do this with a cross-object formula, but cannot find any help or existing entries here regarding it.

 

Has anyone tried this and/or have some idea on how to do this?

 

Thank you.

Best Answer chosen by Admin (Salesforce Developers) 
SovaneSovane

Hi aqkraf,

 

What you can do is to create a Roll Up summary field on the Account object that counts all the opportunities related to it (you could even filter some of them if you need to)

Message Edited by Sovane on 02-03-2009 12:23 AM

All Answers

SovaneSovane

Hi aqkraf,

 

What you can do is to create a Roll Up summary field on the Account object that counts all the opportunities related to it (you could even filter some of them if you need to)

Message Edited by Sovane on 02-03-2009 12:23 AM
This was selected as the best answer
Steve :-/Steve :-/

Like Sovane said, you can create a custom roll-up summary field on the account.

 


 

Field Information: Field Label: Opportunity Count Open Object Name: Account Field Name: Opportunity_Count_Open API Name: Opportunity_Count_Open__c Description: Count of Open Opportunities Help Text: Count of Open Opportunities Data Type: Roll-Up Summary Summary Type: COUNT Summarized Object: Opportunity Filter Criteria: Closed equals False

 

 

(you can take out the line about the Opportunity Being Open)

 

 

tmbarrytmbarry

Is there any way to do the same thing for contacts i.e., add a field to the account object that calculates the total number of contacts associated with and account?

 

Todd B.