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
Hari G SHari G S 

To get the number of opportunities in an Account

 

Hi,

 

Is there any simple way to get the number of opportunities added to an account? Is count query available in SOQL?

 

Thanks and Regards

Hari  G S

Best Answer chosen by Admin (Salesforce Developers) 
Cloud Arena AdminCloud Arena Admin

yes you can do that by using a simple count() query.

This is how it works :

Select count() From Opportunity Where AccountId ='some Account Id'