Saturday, 15 January 2011

rest - Determine the number of records in a saleforce table without knowing the table's field names -


I'm using the Salesforce REST API to determine the number of records in each Salesforce table, ideally I The table will be able to do a query like this:

  SELECT COUNT (*) FROM & lt; Variable_table_name & gt; - or - SELECT COUNT () FROM & lt; Variable_table_name & gt;  

Unfortunately, SOQL does not support * select all without any code running COUNT () Either it does not work either.

My last resort is a two step process:

  1. Use the SOBJX field to get the name of the resource
  2. with that field name < Code> COUNT

This means that I would not like to do this for two tablets instead of just one of two network calls.

To use it, COUNT () thanks Salman without any fields The problem for me was that the web response to COUNT (Id) is different from the web response to COUNT () .

WebResponse content

  {"totalize": 1, "done": true, "records": [{"attributes": {"type" : "Aggregate result"}, "exprode": 260}]  

COUNT web content

 {"totalSize ": 260," done ": true," records ": []}  

When using COUNT () , I should Records.expr0 to see property instead of totalSize


No comments:

Post a Comment