<?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: FeatureLayer using FeatureCollection option ... query exception thrown in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17094#M1579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am responding to this thread so that anyone else who encounters this issue is aware of the limitations of the software (intended or not).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that this exception will continue to be thrown when creating a FeatureLayer with the FeatureCollection option if you do not spatially enable the Layer. So the example above that I have shown, creates a new esri FeatureLayer with no geometry since it is intended to be a related Table not Feature Class.&amp;nbsp; In order to get the functionality to work as intended, you must have geometry included in your layer definition and then you can query the records using the query.objectIds paramater.&amp;nbsp; Once I added a "fake" geometry and then used the applyEdits to add a new record (with null geometry) I was able to successfully retrieve the records of interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, the good new is that I have it working ... even if it means that I must insert null geometry. I am not sure if ESRI is aware of this limitation as it would be a functionality that not too many people really use (I guess).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Aug 2013 14:33:12 GMT</pubDate>
    <dc:creator>DianaBenedict</dc:creator>
    <dc:date>2013-08-05T14:33:12Z</dc:date>
    <item>
      <title>FeatureLayer using FeatureCollection option ... query exception thrown</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17093#M1578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Background:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- ArcGIS Server 10.1 sp1 using JS API 3.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Web Editing Application editing SDE Data (works fine .. for the most part)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Issue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have hit a roadblock when attempting to use a FeatureCollection to hold potential related attribute records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workflow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Utilize the FeatureLayer with FeatureCollection option to create a temporary table to hold additional attributes for an edit featureLayer.&amp;nbsp; I have a feature class that I have served as a featureService in ArcGIS server. We would like to provide the option to allow the user to specify additional attributes stored in a seperate attribute table (no relationship class just simple PK-FK relationship). I have successfully used the ESRI AttributeInspector to manage the attribute tables and related tables. However, I was not fond of having an "Add" button to create force the users to create a new record in the related attribute table. I would prefer the record to be preloaded on the page and allow the user to Save the new record or changes back to the table.&amp;nbsp; Because of the way the AttributeInspector dijit works you MUST have records selected in order for them to be displayed in the UI.&amp;nbsp; This is simple to do with FeatureLayers that use a REST URL however, it appears that I am running into a roadblock when selecting records from a FeatureLayer with the FeatureCollection option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception/Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting the following exception thrown when attempting to retrieve/select the newly created record from the FeatureCollection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"FeatureLayer::selectFeatures - query contains one or more unsupported parameters"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Supporting&amp;nbsp; Research Information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI Documentation: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#featurelayer2" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#featurelayer2&lt;/A&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Forum Post: Clone a Server-based FeatureLayer to a local one? &lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/14665-clone-a-server-based-featurelayer-to-a-local-one" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/14665-clone-a-server-based-featurelayer-to-a-local-one&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Dasa Paddock indicated that I should be able to use a query with objectIds paramater set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;1.) You can select features in a FeatureLayer that's using a FeatureCollection using an Extent geometry, objectIds or timeExtent.&lt;BR /&gt; &lt;BR /&gt;2.) The AttributeInspector should work with a FeatureLayer that's using a FeatureCollection. &lt;BR /&gt;&lt;BR /&gt;Dasa Paddock &lt;BR /&gt;Esri Flex Team&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Forum Post: AttributeInspector requires a FeatureLayer when using graphics? &lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/65604-AttributeInspector-requires-a-FeatureLayer-when-using-graphics" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/65604-AttributeInspector-requires-a-FeatureLayer-when-using-graphics&lt;/A&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could create a feature collection based feature layer and use that with the AttributeInspector widget.&lt;BR /&gt;.. Kelly Hutchins (ESRI)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does this all mean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exactly .. I am at a standstill. Initially, I had incorrectly used a where paramater with the query for the FeatureCollection but quickly remedied that. I am still getting the same error. Since this is a table with no geometry I do not have the option to select using a geometry paramater.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is the code that I use to test this use case:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //NEW code to test the creation of the FeatureCollection FeatureLayer &amp;nbsp;&amp;nbsp; //I have tried diferent variations of this code and have simplified it down to this &amp;nbsp;&amp;nbsp;&amp;nbsp; var fieldsArray = [{ "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECTID" }, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { "name": "GAZ_ID", "type": "esriFieldTypeInteger", "alias": "GAZ_ID" }, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { "name": "GAZ_FEATUREHISTORY", "type": "esriFieldTypeString", "alias": "GAZ_FEATUREHISTORY", "length": 1073741822 }, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { "name": "GAZ_FEATUREDESCRIPTION", "type": "esriFieldTypeString", "alias": "GAZ_FEATUREDESCRIPTION", "length": 1073741822}]; &amp;nbsp;&amp;nbsp;&amp;nbsp; var layerDefinition = { "type": "Table", "fields": fieldsArray }; &amp;nbsp;&amp;nbsp;&amp;nbsp; var featureCollection = { "layerDefinition": layerDefinition, featureSet: null }; &amp;nbsp;&amp;nbsp;&amp;nbsp; _customFeatureLayer = new esri.layers.FeatureLayer(featureCollection, { "id": "myCustomClass", outFields: ["GAZ_ID", "GAZ_FEATUREHISTORY", "GAZ_FEATUREDESCRIPTION"] }); &amp;nbsp;&amp;nbsp;&amp;nbsp; _customFeatureLayer.setEditable(true); &amp;nbsp;&amp;nbsp;&amp;nbsp; _map.addLayer(_customFeatureLayer);&amp;nbsp; //create the layerInfo to add to the attribute inspector var layerInfos = [{ 'featureLayer': _customFeatureLayer, 'fieldInfos': fieldInfos, 'isEditable': isTableEditable, 'showDeleteButton': false}]; var relTableAttInspector = new esri.dijit.AttributeInspector( &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 'layerInfos': layerInfos }, attributeDivId);&amp;nbsp; //at some point in the app prior to showing the attribut UI I attempt to create a new record in the FeatureCollection layer based on an existing attribute record from the FeatureLayer/table&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _customFeatureLayer.applyEdits(results.selectionLayers[0].features, null, null, function (addResults) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (addResults[0].success) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //var jsonObject = _customFeatureLayer.toJson(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Now select the record so it shows up in the attribute UI &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = [addResults[0].objectId]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["GAZ_ID", "GAZ_FEATUREHISTORY", "GAZ_FEATUREDESCRIPTION"]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _customFeatureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (features) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; helperOperations.hideProcessingDialog(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showAttributePane(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function (e) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processError("Error: " + e.message); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; helperOperations.hideProcessingDialog(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showAttributePane(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, function (error) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processError("Error: unable to insert a record into the custom FeatureLayer"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 16:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17093#M1578</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2013-07-31T16:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer using FeatureCollection option ... query exception thrown</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17094#M1579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am responding to this thread so that anyone else who encounters this issue is aware of the limitations of the software (intended or not).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that this exception will continue to be thrown when creating a FeatureLayer with the FeatureCollection option if you do not spatially enable the Layer. So the example above that I have shown, creates a new esri FeatureLayer with no geometry since it is intended to be a related Table not Feature Class.&amp;nbsp; In order to get the functionality to work as intended, you must have geometry included in your layer definition and then you can query the records using the query.objectIds paramater.&amp;nbsp; Once I added a "fake" geometry and then used the applyEdits to add a new record (with null geometry) I was able to successfully retrieve the records of interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, the good new is that I have it working ... even if it means that I must insert null geometry. I am not sure if ESRI is aware of this limitation as it would be a functionality that not too many people really use (I guess).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 14:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17094#M1579</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2013-08-05T14:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer using FeatureCollection option ... query exception thrown</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17095#M1580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this thread is really old - but maybe you can still help me out? I am getting the same error you did at v3.22.&amp;nbsp; I am creating a feature layer from a feature collection (so all the data is stored client side). My data is already spatial, and I define it as such when I instantiate the featurelayer ("esriGeometryPoint")., but I'm still getting the error. Would you happen to still have the code that you used to get this working? The only difference is that I am not needing to query on objectIds. I just want to query based on a mappoint and distance buffer, and no where statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 14:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17095#M1580</guid>
      <dc:creator>ArjunDongre</dc:creator>
      <dc:date>2017-11-08T14:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer using FeatureCollection option ... query exception thrown</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17096#M1581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also it seems that the queryObjectIDs is mandatory for it to work? This makes no sense to me. Basically I can grab single features from an on click event on the feature layer directly, however, what if &amp;lt;1 point are on top of each other? I want all the data. Hence, I was going to use the queryfeatures with a buffer with a map on click.&amp;nbsp; I don't know what my objectids are, and I don't actually care. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 14:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17096#M1581</guid>
      <dc:creator>ArjunDongre</dc:creator>
      <dc:date>2017-11-08T14:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer using FeatureCollection option ... query exception thrown</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17097#M1582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sorry for the late response, I only just now logged back in to my personal ESRI account and saw this thread. I no longer have access to the code since I do not work at that client - got a new gig. But if you want to share your code, I would be happy to look at it and see if I have any ideas on what might be going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 23:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-using-featurecollection-option-query/m-p/17097#M1582</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2017-12-04T23:17:53Z</dc:date>
    </item>
  </channel>
</rss>

