Using featureLayer.selectFeatures with a query string instead of geometry

444
1
11-29-2012 04:53 AM
AndrewBrown1
Occasional Contributor II
I'm trying to select points on my featureLayer using a query.where string statement instead of providing the geometry of a drawn feature. Is this possible?

var query4 = new esri.tasks.Query();
    query4.returnGeometry = false;
    //query4.outFields = ["STA_NAME"];
    query4.where = "[ID_User] = " + userID + " and [NEWCHEMICAL] = '" + chemical + "' and [STD_ANATYPE] = '" + chem_type + "'";
    pointsLayer.selectFeatures(query4, esri.layers.FeatureLayer.SELECTION_NEW);


Currently, I receive duplicate errors:
Error {code: 400, message: "Unable to complete operation.", details: Array[0], log: undefined, _ssl: undefined}


Any ideas?
Thanks.
0 Kudos
1 Reply
AndrewBrown1
Occasional Contributor II
Forgot to mention that I do declare a selectionSymbol when the featureLayer is defined, earlier in the code:

pointsLayer.setSelectionSymbol(esri.symbol.SimpleMarkerSymbol().setColor("red"));
0 Kudos