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
Silvio AmbrosoneSilvio Ambrosone 

How to know how many records a related object has

Hello and sorry for the banal question but I'm struggling with this. 

So let's say i have this Object that is related with Account, and i need to know how many records of this Object are related with a specific account. Is there a specific method or something i don't know.

Best Answer chosen by Silvio Ambrosone
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Silvio,

Can you check the below question. This will give the number of child records for a parent.

https://salesforce.stackexchange.com/questions/36690/soql-count-number-of-child-records

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Silvio,

Can you check the below question. This will give the number of child records for a parent.

https://salesforce.stackexchange.com/questions/36690/soql-count-number-of-child-records

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Silvio AmbrosoneSilvio Ambrosone
It definitely worked.
Thanks Sai.