Select to view content in your preferred language

Possible to modified Maximum Number of Records returned by Server Behavior

589
3
10-07-2011 08:34 AM
JeffPace
MVP Alum
At 10 you can set the Maximum Number of Records returned by Server by rest service, which is great.  However, if I do I query, i need to know that I got an incomplete result due to this setting.  Is there anyway that if the result exceeds this value to return

"too many records" INSTEAD Of the partial result? Right now the only solution I can see is checking for an exact number of results by query, since each rest service can have a different setting.  Terribly inefficient.

Any ideas?
0 Kudos
3 Replies
KellyHutchins
Esri Notable Contributor
It requires an extra query but you could use the query task's executeForCount method to return a count of the features that match the query. Comparing this to the results returned from execute would let you know if partial results were returned.
If you are working with feature layers you could use the queryCount method.
0 Kudos
StephenLead
Honored Contributor
Hi Kelly,

On a slightly related front, I'd like the ability to break out of executeForCount once a specified number has been reached.

I want to know if there are more than X features, rather than the total number of features, in the layer.

For example, once I know that there are more than 500 features, don't keep counting all 10,000,000 features.

At the moment the only way to test this is to count all features, which can take a long time with complex layers.

Cheers,
Steve
0 Kudos
JeffPace
MVP Alum
Yes We will have to figure something out as well.  I want this to be faster, not slower by adding an extra query.

For us by the time it gets to 500 records IE has already thrown the "script has stopped responding error".
0 Kudos