SELECT qualifiedapiname
FROM EntityDefinition
WHERE IsQueryable = true
AND IsRetrieveable = true
AND IsDeprecatedAndHidden = false
LIMIT 2000
Above query lists all SFDC standard/custom objects. But it also returns objects which have no (zero) records at all and I want to skip/filter them. How can we ?
Is there any field/property metadata in Salesforce's EntityDefinition that can tell if the object has any records in it or if its empty/blank, something like "IsBlank or IsEmpty= true/false" ?
Expected output am looking for is:
Object Name | RecordCount |
---|---|
Account | 100 |
Lead | 20 |
Opportunity | 0 |
Looking at above output, I could filter Opportunity table further in the process since it doesn't have any records/rows yet.
Thanks!