In my Visualforce page, I am trying to retrieve all 884 records from a custom object (GeoPolygon__c). I have written the following SOQL query:
SELECT Id,Name,OwnerId,Owner_Name__c,Owner_Territory_Color__c,Country__c,Population__c,Land_Area__c,Population_Density__c,State__c,State_Code__c,JSON_Geometry__c FROM GeoPolygon__c
When executed in the Developer Console, all 884 records are retrieved. When executed in the Visualforce page, only the first 250 records are retrieved. The query is exactly the same. Here is the full line of code in the Visualforce page:
var geoPolygonQuery = sforce.connection.query("SELECT Id,Name,OwnerId,Owner_Name__c,Owner_Territory_Color__c,Country__c,Population__c,Land_Area__c,Population_Density__c,State__c,State_Code__c,JSON_Geometry__c FROM GeoPolygon__c");
The issue is definitely related to the fact that one of the fields in the query is a long text area field (JSON_Geometry__c). When I remove this field from the query, all 884 records are returned in both Developer Console and in the Visualforce page. When I include this field in the query, only the Developer Console returns all 884 records.
Here are the few similar cases that I was able to track down online:
I tried adding a WHERE clause to the query, as recommended by a few people, but the Visualforce page continues to return only the first 250 records.
How can I retrieve all 884 records? The long text area field must be included in the query. Thank you for any help!