<?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: QueryTask.execute is not a function - Print.js WAB 2.10 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538920#M50206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If "&lt;SPAN style="background-color: #ffffff;"&gt;queryTask.execute is not a function"&amp;nbsp;&lt;/SPAN&gt;is the error, then I would check to make sure that you are creating the QueryTask correctly (ensure that you are correctly importing the module and that the local argument name matches up, e.g.&amp;nbsp;&lt;SPAN class="" style="color: #5c2699;"&gt;require&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;([&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"esri/tasks/QueryTask"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;], &lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;QueryTask&lt;/SPAN&gt;). Then I would inspect the queryTask object in the console and make sure it looks right.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Mar 2019 18:00:58 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2019-03-29T18:00:58Z</dc:date>
    <item>
      <title>QueryTask.execute is not a function - Print.js WAB 2.10</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538919#M50205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the&amp;nbsp;&lt;SPAN&gt;RSheitlin's printing solution for posting attributes into TextElements on a report....which works great.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Decided to get the attributes from QueryTask rather than the graphicsLayer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hangs on queryTask.execute is not a function. Can't get past it. Ideas are welcome.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Researched all of RSheitlin's post on this in the past.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//See if there is a parcel search layer added to the map&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; plyr&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;some&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphicsLayerIds&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerId&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerId&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
          &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Search Results: Parcels"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            plyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
          &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gra &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;infoWindow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getSelectedFeature&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; ppid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gra&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; queryTask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;esriQueryTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://Default_xxxxxx/MapServer/171"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;esriQuery&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;returnGeometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PID = '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ppid &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        queryTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;execute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 


        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;plyr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:22:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538919#M50205</guid>
      <dc:creator>KeithAnderson</dc:creator>
      <dc:date>2021-12-11T23:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask.execute is not a function - Print.js WAB 2.10</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538920#M50206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If "&lt;SPAN style="background-color: #ffffff;"&gt;queryTask.execute is not a function"&amp;nbsp;&lt;/SPAN&gt;is the error, then I would check to make sure that you are creating the QueryTask correctly (ensure that you are correctly importing the module and that the local argument name matches up, e.g.&amp;nbsp;&lt;SPAN class="" style="color: #5c2699;"&gt;require&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;([&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;"esri/tasks/QueryTask"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;], &lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959;"&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;QueryTask&lt;/SPAN&gt;). Then I would inspect the queryTask object in the console and make sure it looks right.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 18:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538920#M50206</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-03-29T18:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask.execute is not a function - Print.js WAB 2.10</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538921#M50207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Noah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I finally found it&amp;nbsp;just before&amp;nbsp;I saw your message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Uncaught Type error: queryTask is not a function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The order of dependencies in your require statement have to match the order of the corresponding variable names.&lt;/P&gt;&lt;P&gt;I assumed that ESRI Print.js in WAB would match, but they do not!&lt;/P&gt;&lt;P&gt;There are approximately 47 dependencies in the define but only 31 variable names in the function.&lt;/P&gt;&lt;P&gt;I added in the missing digit/form variables so everything lined up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two new variables I added at the bottom were fine all the time but because they did not correspond to the define dependencies they always failed with error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think its safe for me to say that&amp;nbsp;&lt;STRONG&gt;Uncaught Type error: xxxxx is not a function&amp;nbsp;&lt;/STRONG&gt;is a probable issue with your variable names and variable counts at the top of your Define.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 20:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-execute-is-not-a-function-print-js-wab-2/m-p/538921#M50207</guid>
      <dc:creator>KeithAnderson</dc:creator>
      <dc:date>2019-03-29T20:12:36Z</dc:date>
    </item>
  </channel>
</rss>

