0 votes
1 view
in Salesforce by (11.9k points)

First of all, I'm not the one developing this but I'm the one with the SO account. My SF knowledge is almost non-existent.

Basically, the problem is that a query is returning only 500 rows from our PHP script. However, when we substitute that query (directly within the PHP) with another, that query returns over 1500 rows. There are definitely over 500 rows that ought to be returned by the first query - I've checked using the data explorer.

Here's the first query:

SELECT Id,WEBSITE_ExternalId__c,Name,


from Account

And here is the second:

from Feedback__c 
ORDER BY CreatedDate ASC
Any clues? I appreciate this might not be enough information but I don't know much about Salesforce. If there's anything else you'd need to answer this, ask and I'll see what I can do.

1 Answer

0 votes
by (31k points)

For a large number of results, they are batched by the query call, you'll get so many rows, with a token you can use to fetch the next batch and so on. There's a done flag in the query result, which indicates if this is the last batch in the results or not. If this is false you need to call queryMore passing in the queryLocator (also returned in the queryResult structure). See the docs/examples on query/queryMore.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !