<?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.applyEdits(...) causes error &amp;quot;TypeError: _178.geometry is null&amp;quot; in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709648#M66001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI, I have encountered the same error under the same circumstances. It seems related to the use of featureLayer.getSelectedFeatures() to define the graphic. I have a function that fires whenever a feature is selected in my featureLayer, and that function is being triggered by the applyEdits() function somehow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pretty strange behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2012 18:36:10 GMT</pubDate>
    <dc:creator>ReneeMaxwell</dc:creator>
    <dc:date>2012-12-06T18:36:10Z</dc:date>
    <item>
      <title>FeatureLayer.applyEdits(...) causes error &amp;quot;TypeError: _178.geometry is null&amp;quot;</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709647#M66000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to update an existing feature using the following peace of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
var selectedTourSection = layerUtilProvider.getSelectedFeatures();
if (selectedTourSection.length &amp;gt; 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectedTourSection[0].attributes.STATUS = 1;
&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; selectedOperationalLayer.applyEdits(null, [selectedTourSection[0]], null,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function () {
&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; isTourSectionSelected = true;
&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; function (error) {
&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; console.log(error);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My feature "selectedTourSection" has a valid geometry assigned to it (checked using Firebug). The "applyEdits" functions even returns with success (response taken from Firebug):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;addResults[] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateResults[Object { objectId=2,&amp;nbsp; success=true}] ... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;deleteResults[]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/HTML] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but nevertheless the following error appears in the Firebug console:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: _178.geometry is null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no idea what is actually causing this problem. I would be thankful if anyone could shed some light on this issue. Thank you very much in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thomas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 14:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709647#M66000</guid>
      <dc:creator>ThomasLaue</dc:creator>
      <dc:date>2012-11-28T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.applyEdits(...) causes error "TypeError: _178.geometry is null"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709648#M66001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI, I have encountered the same error under the same circumstances. It seems related to the use of featureLayer.getSelectedFeatures() to define the graphic. I have a function that fires whenever a feature is selected in my featureLayer, and that function is being triggered by the applyEdits() function somehow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pretty strange behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 18:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709648#M66001</guid>
      <dc:creator>ReneeMaxwell</dc:creator>
      <dc:date>2012-12-06T18:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.applyEdits(...) causes error "TypeError: _178.geometry is null"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709649#M66002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I seem to have found a fix, assuming our problems are related.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was getting errors whenever I used getSelectedFeatures() to return a graphic and then pass that graphic to applyEdits(). Try using featureLayer.clearSelection() before you call applyEdits(). That seems to do the trick.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case, I noticed that every time I called applyEdits(), the feature I just updated/deleted was firing 'onSelectionComplete', which would return null and throw errors. I have no idea why using getSelectedFeatures() before applyEdits() triggers a feature selection upon 'onEditsComplete', but there it is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope that helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 18:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-applyedits-causes-error-amp-quot/m-p/709649#M66002</guid>
      <dc:creator>ReneeMaxwell</dc:creator>
      <dc:date>2012-12-10T18:41:16Z</dc:date>
    </item>
  </channel>
</rss>

