<?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: Edit operation not deleting rows in table in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225306#M8957</link>
    <description>&lt;P&gt;Well it was worth a try.&amp;nbsp; &amp;nbsp;I will use an Enterprise table to try this.&amp;nbsp; I didn't see anything wrong with your code.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 17:51:53 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2022-10-25T17:51:53Z</dc:date>
    <item>
      <title>Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225241#M8954</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm having an issue deleting rows from a table using the EditOperation class. My code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;            QueuedTask.Run(() =&amp;gt;
            {
                Table dnoXrefTable = Utilities.GetPrdTable("SPATIAL.DNO_XREF");
                QueryFilter qf = new QueryFilter { WhereClause = $"FACILITYID='{facilityId}' AND FEATURECLASS='{featureClassName}'" };
                var deleteOperation = new EditOperation();
                deleteOperation.Name = "Delete features";
                using (var rowCursor = dnoXrefTable.Search(qf, false))
                {
                    while (rowCursor.MoveNext())
                    {
                        using (var row = rowCursor.Current)
                        {
                            deleteOperation.Delete(row);
                        }
                    }
                }
                deleteOperation.Execute();
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;No errors but data isn't removed from the table after it runs. I can delete the features manually so I don't think it's a permissions issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 16:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225241#M8954</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-25T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225296#M8955</link>
      <description>&lt;P&gt;Instead of using EditOperation you can also use this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;dnoXrefTable.DeleteRows(qf);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 17:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225296#M8955</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-25T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225303#M8956</link>
      <description>&lt;P&gt;Thanks Wolf. Unfortunately I get an error saying it cannot be edited outside of an edit session (I assume because it's an enterprise table).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 17:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225303#M8956</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-25T17:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225306#M8957</link>
      <description>&lt;P&gt;Well it was worth a try.&amp;nbsp; &amp;nbsp;I will use an Enterprise table to try this.&amp;nbsp; I didn't see anything wrong with your code.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 17:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225306#M8957</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-25T17:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225394#M8959</link>
      <description>&lt;P&gt;I tried your code snippet with a SQL Server Enterprise GDB and it works as expected.&amp;nbsp; Here are my modifications:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
  if (MapView.Active == null)
  {
    MessageBox.Show("No active map");
    return;
  }
  QueuedTask.Run(() =&amp;gt;
  {
    var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault();
    if (featureLayer == null)
    {
      MessageBox.Show("No Counties feature layer found");
      return;
    }
    Table dnoXrefTable = featureLayer.GetTable();
    QueryFilter qf = new QueryFilter { WhereClause = $"STATE_NAME like ('New%')" };
    var deleteOperation = new EditOperation
    {
      Name = "Delete features"
    };
    using (var rowCursor = dnoXrefTable.Search(qf, false))
    {
      while (rowCursor.MoveNext())
      {
        using (var row = rowCursor.Current)
        {
          deleteOperation.Delete(row);
        }
      }
    }
    var delResult = deleteOperation.Execute();
    if (delResult != true)
      MessageBox.Show($@"Not successful: {deleteOperation.ErrorMessage}");
    MessageBox.Show("Edit operation complete");
  });
}&lt;/LI-CODE&gt;&lt;P&gt;I am using a copy of the Counties dataset (from the c:\data\admin folder using Community Samples data).&amp;nbsp; I coded my queryfilter to delete all counties where the state name contains 'New...'.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my screen shots:&lt;/P&gt;&lt;P&gt;1. Before i click my delete button:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1666727624583.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54391i118A97B21A896950/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1666727624583.png" alt="Wolf_0-1666727624583.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. the delete function has completed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1666727666028.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54392i5E64C22474D747C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1666727666028.png" alt="Wolf_1-1666727666028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. After the OnClick exits (New York and New Hampshire are gone):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_2-1666727740264.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54393i36AAC5F0B79C3932/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_2-1666727740264.png" alt="Wolf_2-1666727740264.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If i run the same delete function again i get this message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_3-1666728166360.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54394iAEA70BE4BB72DDBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_3-1666728166360.png" alt="Wolf_3-1666728166360.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So you get no message at all?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225394#M8959</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-25T20:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225440#M8960</link>
      <description>&lt;P&gt;Thanks again Wolf, I may have a clue in the ErrorMessage property, but it only tells me, &lt;EM&gt;"Not successful: Edit operation failed."&amp;nbsp;&lt;/EM&gt;and nothing else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 21:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225440#M8960</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-25T21:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225450#M8961</link>
      <description>&lt;P&gt;What kind of Enterprise GDB are you using and is the table (or feature class) in the content of your map?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 21:32:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225450#M8961</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-25T21:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225458#M8962</link>
      <description>&lt;P&gt;It's an oracle gdb, and yes I have the table in my Table of Contents to verify the feature is removed/not removed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I should also mention that this is following a RowDeletedEvent. So I delete another feature in the enterprise GDB, and then as part of this process it should delete the corresponding table links in the XREF table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 22:02:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1225458#M8962</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-25T22:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1226471#M8976</link>
      <description>&lt;P&gt;This code worked for me.&amp;nbsp; To test I have a feature class (County) and a table with related records (CountyTable).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1666916609940.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54681iF5678CFB0952E643/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1666916609940.png" alt="Wolf_1-1666916609940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After i subscribe to the featureclass's row delete event, the related record is deleted after the feature is deleted.&amp;nbsp; This screen shot is after i deleted the 'Larimer' county:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_2-1666916720608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54682i504D39B42C84587F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_2-1666916720608.png" alt="Wolf_2-1666916720608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I used the following code to accomplish this.&amp;nbsp; I think the issue is that you have to attach your delete (of the related row) to the 'parent edit operation'.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ActivateRelatedDeletes : Button
{
  private SubscriptionToken _rowDeletedToken;
  private StandaloneTable _countyTable = null;

  protected override void OnClick()
  {
    if (MapView.Active == null)
    {
      MessageBox.Show("No active map");
      return;
    }
    QueuedTask.Run(() =&amp;gt;
    {
      _countyTable = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().OfType&amp;lt;StandaloneTable&amp;gt;().Where(fl =&amp;gt; fl.Name.Contains("CountyTable")).FirstOrDefault();
      if (_countyTable == null)
      {
        MessageBox.Show("Cannot find County Table");
        return;
      }
      var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().Where(fl =&amp;gt; fl.Name.Contains("County")).FirstOrDefault();
      if (featureLayer == null)
      {
        MessageBox.Show("No County feature layer found");
        return;
      }
      var addLinkedOperation = new EditOperation
      {
        Name = "Add linked rows"
      };
      _rowDeletedToken = RowDeletedEvent.Subscribe(OnRowEvent, featureLayer.GetTable());

    });
  }

  private void OnRowEvent(RowChangedEventArgs delEventArgs)
  {
    // get the parent Edit operation
    var deleteEditOp = delEventArgs.Operation;

    // delete all related records using the FIPS relationship
    System.Diagnostics.Trace.WriteLine($@"Deleted related: {delEventArgs.Row["NAME"]}");
    var atts = new Dictionary&amp;lt;string, object&amp;gt;();
    QueryFilter qf = new QueryFilter { WhereClause = $"FIPS = '{delEventArgs.Row["FIPS"]}'" };
    using (var tableCursor = _countyTable.Search(qf))
    {
      while (tableCursor.MoveNext())
      {
        using (var tableRow = tableCursor.Current)
        {
          deleteEditOp.Delete(tableRow);
        }
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 00:31:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1226471#M8976</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-28T00:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1226816#M8988</link>
      <description>&lt;P&gt;Thanks Wolf for all your help thus far. I found swapping my getPrdTable() function for finding it in the table of contents works, so I'll have to diagnose that function, but it still only deletes one row. It iterates through all the rows but after finishing only the last one is deleted. Any idea why? My code for the RowDeletedEvent is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        protected static void OnRowDeletedEvent(RowChangedEventArgs args)
        {
            //Table dnoTable = Utilities.GetPrdTable("SPATIAL.DNO_XREF");
            StandaloneTable dnoTable = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().OfType&amp;lt;StandaloneTable&amp;gt;().FirstOrDefault(); // (only one standalone table in ToC)
            var deleteOperation = args.Operation;

            QueryFilter qf = new QueryFilter { WhereClause = $"FACILITYID='{args.Row["FACILITYID"]}' AND FEATURECLASS='{args.Row.GetTable().GetDefinition().GetModelName()}'" }; // multiple feautres
            using (var rc = dnoTable.Search(qf))
            {
                while (rc.MoveNext())
                {
                    using (var deleteRow = rc.Current)
                    {
                        string oid = deleteRow["OBJECTID"].ToString();
                        deleteOperation.Delete(deleteRow);
                    }
                }
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 17:02:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1226816#M8988</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-31T17:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227106#M8991</link>
      <description>&lt;P&gt;So you see the "Objectid: ..." output for multiple records but only the last record is being deleted?&amp;nbsp; I have implemented the same scenario also with a one-to-many relationship and all my related records are deleted.&lt;/P&gt;&lt;P&gt;Which release of ArcGIS Pro are you using?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 17:03:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227106#M8991</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-31T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227109#M8992</link>
      <description>&lt;P&gt;Yep, I see see each unique ObjectID in the output. I'm on ArcGIS Pro 3.0.0, I will try updating to the latest version.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe also worth mentioning: I have a similar function somewhere else in my add-in, but this is tied to a dockpane to allow users to delete entries manually. The code here is as follows, with the main difference (as far as I can see) being this doesn't use the RowDeletedEvent:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public ICommand CmdDeleteDrawing
        {
            get
            {
                return new RelayCommand(() =&amp;gt;
                {
                    if (_selectedDrawingEntry == null)
                    {
                        MessageBox.Show("Please select a drawing to remove first.");
                    }
                    else
                    {
                        QueuedTask.Run(async () =&amp;gt;
                        {
                            Table dnoXrefTable = Utilities.GetPrdTable("SPATIAL.DNO_XREF");
                            var deleteDrawing = new EditOperation();
                            deleteDrawing.Name = "Delete Drawing";
                            QueryFilter qf = new QueryFilter { WhereClause = $"DNO_ID={_selectedDrawingEntry.DnoId} AND FACILITYID={_selectedDrawingEntry.FacilityId}" };
                            RowCursor rc = dnoXrefTable.Search(qf, false);
                            while (rc.MoveNext())
                            {
                                Row dr = rc.Current;
                                deleteDrawing.Delete(dr);
                                deleteDrawing.Execute();
                                await Project.Current.SaveEditsAsync();
                            }
                        });
                    }
                });
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;This method works no problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 17:11:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227109#M8992</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-31T17:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227229#M8993</link>
      <description>&lt;P&gt;Actually, after i tried your use case with my code snippet again i realized that my dataset didn't really represent the one-to-many (related records) use case property, instead with my data i always only had one related record that was correctly deleted.&amp;nbsp; After changing my query logic, i was able to duplicate the same problem that you are seeing.&amp;nbsp; I think that this is actually a bug.&amp;nbsp; I will pass this on to the Editor team.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there is a workaround for this issue.&amp;nbsp; &amp;nbsp;You can use the EditOperation Delete method on the table instead of deleting each row.&amp;nbsp; The following code snippet worked for me:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// collect all object ids that need to be deleted
List&amp;lt;long&amp;gt; ids = new List&amp;lt;long&amp;gt;();
using (var tableCursor = _countyTable.Search(qf))
{
  while (tableCursor.MoveNext())
  {
    using (var tableRow = tableCursor.Current)
    {
      //not working as expected: deleteEditOp.Delete(tableRow);
      ids.Add(tableRow.GetObjectID());
    }
  }
}
// delete all records with objects ids
deleteEditOp.Delete(_countyTable, ids);&lt;/LI-CODE&gt;&lt;P&gt;Can you check if this works for you?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 19:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227229#M8993</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-31T19:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227239#M8994</link>
      <description>&lt;P&gt;Yes, that works! What a relief, thank you again for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 19:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227239#M8994</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-10-31T19:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227522#M8995</link>
      <description>&lt;P&gt;Sorry Wolf if I could add one more addendum to this: I'm still having issues deleting records from the table using DatabaseConnectionProperties instead of through the ToC and I'm wondering if this is also a bug. Running with breakpoints I see the table is populated but nothing is deleted after it finishes. Accessing this table in my other dockpane using the same code works as expected, but only has issues in the RowDeletedEvent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected static void OnRowDeletedEvent(RowChangedEventArgs args)
        {
            DatabaseConnectionProperties connectionProperties = new DatabaseConnectionProperties(EnterpriseDatabaseType.Oracle)
            {
                AuthenticationMode = AuthenticationMode.DBMS,
                User = "user",
                Password = "password",
                Instance = @"instance"
            };

            Geodatabase geodatabase = new Geodatabase(connectionProperties);
            Table dnoTable = geodatabase.OpenDataset&amp;lt;Table&amp;gt;("SPATIAL.DNO_XREF");

            var deleteOperation = args.Operation;
            QueryFilter qf = new QueryFilter { WhereClause = $"FACILITYID='{args.Row["FACILITYID"]}' AND FEATURECLASS='{args.Row.GetTable().GetDefinition().GetModelName()}'" }; 
            List&amp;lt;long&amp;gt; oids = new List&amp;lt;long&amp;gt;();
            using (var rc = dnoTable.Search(qf))
            {
                while (rc.MoveNext())
                {
                    using (var deleteRow = rc.Current)
                    {
                        oids.Add(deleteRow.GetObjectID());
                    }
                }
            }
            deleteOperation.Delete(dnoTable, oids);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 16:38:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1227522#M8995</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2022-11-01T16:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Edit operation not deleting rows in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1228538#M9009</link>
      <description>&lt;P&gt;There are two issues i can see here:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; When you use:&amp;nbsp; 'var deleteOperation = args.Operation;' meaning you try to use the existing (executing) EditOperation, you cannot include a table or feature class that is not already on the map (table of content) during that edit session.&amp;nbsp; In other words, you can only include tables and feature classes that are part of your map in your editoparation in order to make any changes part of an undo/redo operation.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;2) You should not open a new database connection each time you delete a record.&amp;nbsp; The database connection should be established once in your session for various reasons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you really can't include the standalone table in your TOC you should still adhere to my 2. point above and try to create the database connection only once and then use Table.DeleteRows (QueryFilter) (&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic14080.html" target="_blank" rel="noopener"&gt;DeleteRows Method—ArcGIS Pro&lt;/A&gt;) to delete the related rows.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 21:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/edit-operation-not-deleting-rows-in-table/m-p/1228538#M9009</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-11-03T21:31:38Z</dc:date>
    </item>
  </channel>
</rss>

