<?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 EditOperation IsEmpty after attribute change in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357442#M10809</link>
    <description>&lt;P&gt;I'm calling this code from a button on a dockpane. The current attribute value is null and I am changing the value to a number, so there should be a change, but the modifyFeature Edit Operation is empty after the Modify. Any ideas on what might be causing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        public static void SetFieldInt(Map? map, string layerName, string fieldName, int value)
        {
            try
            {
                if (map is null) return;
                BasicFeatureLayer? featureLayer = (BasicFeatureLayer?)FindLayer(map, layerName);
                if (featureLayer is null)
                    return;
                else
                {
                    Selection selectedFeatures = featureLayer.GetSelection();
                    var modifyInspector = new Inspector();
                    using (RowCursor rowCursor = selectedFeatures.Search())
                    {
                        while (rowCursor.MoveNext())
                        {
                            if (rowCursor.Current is not Feature feature) return;
                            long oid = feature.GetObjectID();
                            if (feature != null)
                            {
                                object den = feature[2];
                            }
                            modifyInspector.Load(featureLayer, feature.GetObjectID());
                            var modifyFeature = new EditOperation
                            {
                                Name = "Modify a feature"
                            };
                            modifyInspector[fieldName] = value;
                            modifyFeature.Modify(modifyInspector);
                            if (!modifyFeature.IsEmpty)
                            {
                                var result = modifyFeature.Execute();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new SystemException((System.Reflection.MethodBase.GetCurrentMethod()!.Name ?? "Unknown") + ": " + ex.Message);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;-&amp;nbsp; David Wilcox&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2023 16:32:44 GMT</pubDate>
    <dc:creator>DaveWilcox</dc:creator>
    <dc:date>2023-12-06T16:32:44Z</dc:date>
    <item>
      <title>EditOperation IsEmpty after attribute change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357442#M10809</link>
      <description>&lt;P&gt;I'm calling this code from a button on a dockpane. The current attribute value is null and I am changing the value to a number, so there should be a change, but the modifyFeature Edit Operation is empty after the Modify. Any ideas on what might be causing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        public static void SetFieldInt(Map? map, string layerName, string fieldName, int value)
        {
            try
            {
                if (map is null) return;
                BasicFeatureLayer? featureLayer = (BasicFeatureLayer?)FindLayer(map, layerName);
                if (featureLayer is null)
                    return;
                else
                {
                    Selection selectedFeatures = featureLayer.GetSelection();
                    var modifyInspector = new Inspector();
                    using (RowCursor rowCursor = selectedFeatures.Search())
                    {
                        while (rowCursor.MoveNext())
                        {
                            if (rowCursor.Current is not Feature feature) return;
                            long oid = feature.GetObjectID();
                            if (feature != null)
                            {
                                object den = feature[2];
                            }
                            modifyInspector.Load(featureLayer, feature.GetObjectID());
                            var modifyFeature = new EditOperation
                            {
                                Name = "Modify a feature"
                            };
                            modifyInspector[fieldName] = value;
                            modifyFeature.Modify(modifyInspector);
                            if (!modifyFeature.IsEmpty)
                            {
                                var result = modifyFeature.Execute();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new SystemException((System.Reflection.MethodBase.GetCurrentMethod()!.Name ?? "Unknown") + ": " + ex.Message);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;-&amp;nbsp; David Wilcox&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 16:32:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357442#M10809</guid>
      <dc:creator>DaveWilcox</dc:creator>
      <dc:date>2023-12-06T16:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation IsEmpty after attribute change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357480#M10810</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What version of ArcGIS Pro do you use? We have reported bug to Esri for version 3.0. Fixed in&amp;nbsp;&lt;SPAN&gt;3.2, 3.1.4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-editoperationisempty-method-returns-true-after-call-bug-000153875" target="_blank"&gt;BUG-000153875 for ArcGIS Pro SDK for .NET (esri.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 17:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357480#M10810</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-12-06T17:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation IsEmpty after attribute change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357679#M10816</link>
      <description>&lt;P&gt;I was at 3.1.3. Upgrading to 3.2.0 fixed the problem. Thanks!&lt;/P&gt;&lt;P&gt;- Dave&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 20:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/editoperation-isempty-after-attribute-change/m-p/1357679#M10816</guid>
      <dc:creator>DaveWilcox</dc:creator>
      <dc:date>2023-12-06T20:55:03Z</dc:date>
    </item>
  </channel>
</rss>

