Achieve your business goals faster by unlocking our Salesforce Cloud Services.

countQuery(String str)

 Returns the number of records that a dynamic SOQL query would return when executed.

Integer i = Database.countQuery(‘select count() from account’);


Note: countQuery will not work if we enter any field inside the count.

count() // ok

count(ID) // error

Our Recent Blog

Share This Post