1 Reply Latest reply on Apr 24, 2012 1:02 PM by rduke40

    QueryTask not showing results when it should

    rduke40
      In regards to the following thread:  http://forums.arcgis.com/threads/55251-QueryTask-not-returning-results-when-it-should!?highlight=querytask+results 

      I was unable to get anything back from the query I am getting a NULL error on the fault handler.

               var queryTask:QueryTask = new QueryTask(queryLayer);   queryTask.disableClientCaching = true;   var query:Query = new Query();   query.outFields = queryFields.split(",");   query.geometry = map.extent;          query.returnGeometry = true;   query.where = queryExpr;   query.outSpatialReference = map.spatialReference;   queryTask.execute(query, new AsyncResponder(onResult, onFault));
        • Re: QueryTask not showing results when it should
          rduke40
          I figured it out...  My services was 9.3 framework based.  I just added the line of code:    queryTask.useAMF = false;    and it worked.

          Resulting code:

           var queryTask:QueryTask = new QueryTask(queryLayer);      queryTask.disableClientCaching = true;      var query:Query = new Query();      query.outFields = queryFields.split(",");      query.geometry = map.extent;             query.returnGeometry = true;      query.where = queryExpr;      queryTask.useAMF = false;      query.outSpatialReference = map.spatialReference;                queryTask.execute(query, new AsyncResponder(onResult, onFault));