<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to upgrade to 4.24 as I cannot get rest/query to work in place of tasks/QueryTask in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219448#M78924</link>
    <description>&lt;P&gt;The abbreviated setup below is probably along the lines of what you're looking for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var queryTask;
var queryObj;

require(["esri/rest/query/executeQueryJSON","esri/rest/support/Query"], function(QueryTask, Query) {
	queryTask = QueryTask;
	queryObj = new Query();

	//other stuff
});

function runPolygonQuery(qIdx, qErr) {
	//other stuff

	queryTask.executeQueryJSON(sQryUrl+"/" + qIdx, queryObj);
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 16:39:47 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2022-10-06T16:39:47Z</dc:date>
    <item>
      <title>Unable to upgrade to 4.24 as I cannot get rest/query to work in place of tasks/QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219356#M78920</link>
      <description>&lt;P&gt;I am having problems trying to replace the QueryTask for the 4.24 release, since tasks are no longer supported. I was able to do this for Identify and GeometryService tasks, but the query one is not working for me.&lt;BR /&gt;I am using the 4.23 version of the javascript api, and would like to upgrade to 4.24.&amp;nbsp; The issue here is that I cannot seem to create a constructor for rest/query, and my query code all is in a separate module, not within the require block. It's a fairly complex application, and the query module itself is over 1000 lines of code, dynamic html, etc. So I've always created a constructor for the querytask, and used that in the query module. That doesn't seem to be possible now, unless I'm missing something.&lt;/P&gt;&lt;P&gt;I made a stripped down version of this here: &lt;A href="https://codepen.io/jsauder/pen/ExLXLYq" target="_blank"&gt;https://codepen.io/jsauder/pen/ExLXLYq&lt;/A&gt; just showing how the constructor for the query cannot be created, and passed to javascript outside of the require block. If there is a way to do this, I would greatly appreciate if anyone could share this. Thanks in advance for any assistance you may be able to provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 14:44:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219356#M78920</guid>
      <dc:creator>JS_GilbertAZ</dc:creator>
      <dc:date>2022-10-06T14:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to upgrade to 4.24 as I cannot get rest/query to work in place of tasks/QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219383#M78922</link>
      <description>&lt;P&gt;The new query doesn't have a constructor, so instead of creating it using "new query", you have to use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery" target="_self"&gt;createQuery&lt;/A&gt; method on a FeatureLayer.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219383#M78922</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-10-06T15:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to upgrade to 4.24 as I cannot get rest/query to work in place of tasks/QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219448#M78924</link>
      <description>&lt;P&gt;The abbreviated setup below is probably along the lines of what you're looking for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var queryTask;
var queryObj;

require(["esri/rest/query/executeQueryJSON","esri/rest/support/Query"], function(QueryTask, Query) {
	queryTask = QueryTask;
	queryObj = new Query();

	//other stuff
});

function runPolygonQuery(qIdx, qErr) {
	//other stuff

	queryTask.executeQueryJSON(sQryUrl+"/" + qIdx, queryObj);
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 16:39:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-upgrade-to-4-24-as-i-cannot-get-rest/m-p/1219448#M78924</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-10-06T16:39:47Z</dc:date>
    </item>
  </channel>
</rss>

