You need to sign in to do that
Don't have an account?
Deepika Ghose
SOQL Query to count record types
SOQL query to count the no of record types present in a page
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
One simple solution to it is
List<AggregateResult> ag= [SELECT count(Id) tc, RecordTypeId FROM Static_Data__c group by RecordTypeId];
for(AggregateResult ag:ags)
System.debug(ag.get('RecordTypeId') +' '+ ag.get('tc'));
Replace Static_Data__c by ur object name . Let me know if you face any problems
Thanks and Regards,
Shiva RV
List<AggregateResult> ags = [SELECT count(Id) tc,RecordType.Name recName FROM Static_Data__c group by RecordType.Name ];
for(AggregateResult ag:ags)
System.debug(ag.get('recName') +' '+ ag.get('tc'));
This will give the same answer with recordType name and count result
Thanks and Regards,
Shiva RV
Refer this for more information .
http://www.jonathanbroquist.com/retrieving-sobject-recordtypeid-dynamically-with-salesforce/