AnsweredAssumed Answered

QueryTask.execute is not a function - Print.js WAB 2.10

Question asked by KeitherJ on Mar 29, 2019
Latest reply on Mar 29, 2019 by KeitherJ

I am using the RSheitlin's printing solution for posting attributes into TextElements on a report....which works great.

Decided to get the attributes from QueryTask rather than the graphicsLayer.

Hangs on queryTask.execute is not a function. Can't get past it. Ideas are welcome.

Researched all of RSheitlin's post on this in the past.

 

 

//See if there is a parcel search layer added to the map
        var plyr;
        array.some(this.map.graphicsLayerIds, lang.hitch(this, function (layerId) {
          var lyr = this.map.getLayer(layerId);
          if(lyr.name === "Search Results: Parcels"){
            plyr = lyr;
            return true;
          }
        }));

        var gra = this.map.infoWindow.getSelectedFeature();
        var ppid = gra.attributes.PID;

        var queryTask = new esriQueryTask("https://Default_xxxxxx/MapServer/171");

        var query = new esriQuery();
        query.returnGeometry = false;
        query.outFields = ["*"];
        query.where = "PID = '" + ppid + "'";
        queryTask.execute(query, lang.hitch(this, function(results) {
          console.log(results.features)
        }));


        if(plyr){

 

Keith

Outcomes