ads

Tuesday, 28 August 2018

To Get The Record Count Of SOQL query into a variable in Salesforce

Code Format:


    public static Integer ContactCount() {
        return [ SELECT COUNT() FROM Contact ];
    }

Or

Integer n = [ SELECT COUNT() FROM Contact ]; 

No comments:

Post a Comment