I'm using the Salesforce REST API to determine the number of records in each Salesforce table. Ideally, I would be able to a query like this on each table:
SELECT COUNT(*) FROM <variable_table_name>
--or--
SELECT COUNT() FROM <variable_table_name>
Unfortunately, SOQL does not support *
as select all. Running COUNT()
without a field doesn't work either. How can we determine how many rows each table contains without knowing the name of at least one field?
My last resort is a two step process:
- Use the SObject Describe resource to retrieve a field name
- use
COUNT
with that field name
That means two network calls for each table rather than just one. I'd prefer not to do that.