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
Ashish BiswasAshish Biswas 

How to get count of 10 million records

Hi,
As Count() returns integer and works fine with less than 50K records, how shall I get the total no of rows from an object where approax records will be 10 millions.
Please suggest
Regards
Ashish
Abhijeet Anand 6Abhijeet Anand 6
You need to make use of batch apex. Through batch apex, you can work on 50 million records. Query your records, collect them in a list and find the size of the list. It will give you the record count.

Thanks 
Abhijeet