50000超えたレコード数取得の場合
Integer intCount = 0;
for (AggregateResult result : [SELECT COUNT(Id) cnt from objName__c]) {
intCount+=(Integer)result.get('cnt');
}
System.debug('No of records are: '+intCount);
50000超えたレコード数取得の場合
Integer intCount = 0;
for (AggregateResult result : [SELECT COUNT(Id) cnt from objName__c]) {
intCount+=(Integer)result.get('cnt');
}
System.debug('No of records are: '+intCount);