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
kumar_arunkumar_arun 

count of all Sobjects Record in salesforce org Using Apex

Hi everyone,
I want to get all sobject records of salesforce org, we can view this on -Data Management-->Storage Usage, but how can i get all sobject record count using Apex. If you have any solution, please let me know.
NagendraNagendra (Salesforce Developers) 
Hi Kumar,

If you aren't concerned about having this information available in code, you can get this information by going to the setup menu -> System Overview (3rd link from the top on the left-side menu) -> click on the number listed under 'Data Storage'.

For URL-hackers, it's salesforce.com/setup/org/orgstorageusage.jsp?id=<your orgId>.

Under the 'Data Storage' header, this page shows you a count of how many records of each object (standard and custom) the org contains, as well as the amount of storage space each object is consuming, sorted by storage space used.

Hope this helps.

Mark this as solved if it's resolved.

Regards,
Nagendra.

 
kumar_arunkumar_arun
Hi Nagendra 
I want count information in code.

Thanks