<?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: query.orderByFields bug in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160259#M14953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;After applying the ArcGIS Server 10.1 Quality Improvement Patch we're getting errors on queries using the orderByFields parameter.&lt;BR /&gt;&lt;BR /&gt;query.outSpatialReference = map.spatialReference;&lt;BR /&gt;query.returnGeometry = false;&lt;BR /&gt;query.outFields = ["*"];&lt;BR /&gt;query.where = "1=1";&lt;BR /&gt;&lt;STRONG&gt;query.orderByFields = ["OBJECTID"];&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The js api encodes this into the request as &lt;BR /&gt;orderByFields=OBJECTID&amp;nbsp; &amp;lt;-- FAILS&amp;nbsp; with "&lt;SPAN style="font-style:italic;"&gt;{"error":{"code":400,"message":"Unable to complete operation.","details":[]}}&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;Running the same query through the rest service explorer results in that parameter being encoded as&lt;BR /&gt;orderByFields=["OBJECTID"]&amp;nbsp;&amp;nbsp; &amp;lt;--- WORKS&lt;BR /&gt;&lt;BR /&gt;I can confirm our endpoint table Supports Advanced Queries and I have tested this against the latest api version.&lt;BR /&gt;Is there another query parameter that I'm missing?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Terrible work around but have you tried&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;query.orderByFields = ["[\"OBJECTID\"]"];&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Feb 2014 16:56:28 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2014-02-19T16:56:28Z</dc:date>
    <item>
      <title>query.orderByFields bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160258#M14952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After applying the ArcGIS Server 10.1 Quality Improvement Patch we're getting errors on queries using the orderByFields parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.outSpatialReference = map.spatialReference;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.returnGeometry = false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.outFields = ["*"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.where = "1=1";&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;query.orderByFields = ["OBJECTID"];&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The js api encodes this into the request as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;orderByFields=OBJECTID&amp;nbsp; &amp;lt;-- FAILS&amp;nbsp; with "&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;{"error":{"code":400,"message":"Unable to complete operation.","details":[]}}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Running the same query through the rest service explorer results in that parameter being encoded as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;orderByFields=["OBJECTID"]&amp;nbsp;&amp;nbsp; &amp;lt;--- WORKS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can confirm our endpoint table Supports Advanced Queries and I have tested this against the latest api version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there another query parameter that I'm missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:00:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160258#M14952</guid>
      <dc:creator>StevenHaslemore</dc:creator>
      <dc:date>2014-02-19T16:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: query.orderByFields bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160259#M14953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;After applying the ArcGIS Server 10.1 Quality Improvement Patch we're getting errors on queries using the orderByFields parameter.&lt;BR /&gt;&lt;BR /&gt;query.outSpatialReference = map.spatialReference;&lt;BR /&gt;query.returnGeometry = false;&lt;BR /&gt;query.outFields = ["*"];&lt;BR /&gt;query.where = "1=1";&lt;BR /&gt;&lt;STRONG&gt;query.orderByFields = ["OBJECTID"];&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The js api encodes this into the request as &lt;BR /&gt;orderByFields=OBJECTID&amp;nbsp; &amp;lt;-- FAILS&amp;nbsp; with "&lt;SPAN style="font-style:italic;"&gt;{"error":{"code":400,"message":"Unable to complete operation.","details":[]}}&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;Running the same query through the rest service explorer results in that parameter being encoded as&lt;BR /&gt;orderByFields=["OBJECTID"]&amp;nbsp;&amp;nbsp; &amp;lt;--- WORKS&lt;BR /&gt;&lt;BR /&gt;I can confirm our endpoint table Supports Advanced Queries and I have tested this against the latest api version.&lt;BR /&gt;Is there another query parameter that I'm missing?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Terrible work around but have you tried&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;query.orderByFields = ["[\"OBJECTID\"]"];&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:56:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160259#M14953</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-19T16:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: query.orderByFields bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160260#M14954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Terrible work around but have you tried&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;STRONG&gt;query.orderByFields = ["[\"OBJECTID\"]"];&lt;/STRONG&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Very sneaky, the old sting that looks like an array inside an array trick, it works!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 20:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160260#M14954</guid>
      <dc:creator>StevenHaslemore</dc:creator>
      <dc:date>2014-02-19T20:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: query.orderByFields bug</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160261#M14955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;im a hack, i almost dont want credit for that!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad it worked, make sure you comment it well in your code so when it changes back in the next version you can find it quickly and revert &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2014 14:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-orderbyfields-bug/m-p/160261#M14955</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2014-02-20T14:52:41Z</dc:date>
    </item>
  </channel>
</rss>

