Search code examples
salesforcesoql

SalesForce limit on SOQL?


Using the PHP library for salesforce I am running:

SELECT ... FROM Account LIMIT 100

But the LIMIT is always capped at 25 records. I am selecting many fields (60 fields). Is this a concrete limit?

The skeleton code:

$client = new SforceEnterpriseClient();
$client->createConnection("EnterpriseSandboxWSDL.xml");
$client->login(USERNAME, PASSWORD.SECURITY_TOKEN);

$query = "SELECT ... FROM Account LIMIT 100";
$response = $client->query($query);

foreach ($response->records as $record) {
   // ... there's only 25 records
}

Solution

  • Here is my check list

    1) Make sure you have more than 25 records

    2) after your first loop do queryMore to check if there are more records

    3) make sure batchSize is not set to 25