AnsweredAssumed Answered

Does a featureLayer, based on a featureCollection, support query by ObjectID?

Question asked by stevel on Feb 17, 2013
Latest reply on Feb 19, 2013 by stevel
It's possible to create a featureLayer on-the-fly using a featureCollection, as described at, which also mentions:

  • The feature layer generates a unique object id for new features.

  • [/FONT][FONT=Lucida Grande]Does not support queries that need to be performed on the server, e.g. queries with a where clause

Does this mean that a featureLayer based on a featureCollection will not support featureLayer.queryFeatures based on query.objectIds as in this example?

 var query = new esri.tasks.Query(); query.objectIds = [features[0].attributes.OBJECTID]; query.outFields = [ "*" ]; // Query for the features with the given object ID featureLayer.queryFeatures(query, function(featureSet) { });

I'm seeing sporadic results, with the query sometimes working and sometimes not working. Unfortunately I don't have an easily reproducible piece of code that I can share.

Thanks for any advice,