AnsweredAssumed Answered

Error at simple QueryTask on large map service layer

Question asked by piterpaulppp on Nov 10, 2016
Latest reply on Nov 10, 2016 by rscheitlin

Hi, we try to run simple QueryTask on large (1.5 million features) map service layer:

 

var queryTask = new QueryTask("someURL/arcgis/rest/services/Polygons2/MapServer/0");

var query = new Query();
query.returnGeometry = true;
query.outFields = ["Name1,Name2"];


query.where = "SomeID = 12345";
queryTask.execute(query, _showResults, _displayError);

 

_showResults = function (features) {
selectedGraphics.clear();

for (var i = 0; i < features.length; i++) {
var feature = features[i];
feature.symbol = HighlightSymbol;
selectedGraphics.add(feature);
}

 

_displayError = function (error) {
console.log(error);
alert("Error");
};

 

We have the error:

 

Error: Failed to execute query.
at Object.g.load (https://js.arcgis.com/3.17/init.js:857:426)
at https://js.arcgis.com/3.17/init.js:87:450
at c (https://js.arcgis.com/3.17/init.js:103:393)
at d (https://js.arcgis.com/3.17/init.js:103:182)
at b.Deferred.resolve.callback (https://js.arcgis.com/3.17/init.js:105:10)
at c (https://js.arcgis.com/3.17/init.js:104:96)
at d (https://js.arcgis.com/3.17/init.js:103:182)
at b.Deferred.resolve.callback (https://js.arcgis.com/3.17/init.js:105:10)
at https://js.arcgis.com/3.17/init.js:92:118
at h (https://js.arcgis.com/3.17/init.js:107:279)

 

Please help to understand/fix the error.

Outcomes