AnsweredAssumed Answered

Query and QueryTask Not Returning Results ... Error In Syntax?

Question asked by john_richardson_1969 on Oct 3, 2018
Latest reply on Oct 3, 2018 by rscheitlin
var layerURL = "http://172.20.25.165:6080/arcgis/rest/services/Crime2018/FeatureServer/";            //querys the crimes layer for all burglaries
      var burgresultsLayer = new GraphicsLayer();

            var burgQsym = {                                       //creates the symbol for burglaries query
            type: "simple-marker",
            color: "green",
            style: "triangle",
            size: 8
      };
      /*alert(layerURL);*/
      var qTask = new QueryTask({url : layerURL});
      var burgQuery = new Query();
      burgQuery.returnGeometry = true;
      var fieldBoys = burgQuery.outFields = ["Offense", "Location"];
      /*alert(fieldBoys);*/
      burgQuery.where = "Offense = Burglary";
      qTask.execute(burgQuery).then(function(results) {
            console.log(results.features);
      });
      qTask.executeForCount(burgQuery).then(function(results) {
            console.log(results);
      });

Outcomes