Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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:

SELECT Id,WEBSITE_ExternalId__c,D_STANDARD_Age__c,
..............
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 (32.1k points)
edited by

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.

Learn about Salesforce by signing up for this professional Salesforce course online!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...