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

Sample Code:

    public static Integer findAcctCount() {
        return [ SELECT COUNT() FROM Account ];
    }

Or

Integer i = [ SELECT COUNT() FROM Account ]; 

No comments:

Post a Comment