<?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: Weird Issue with onDeleteFeature event in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91537#M2401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It took a while but I eventually figured out that I was just using the wrong NuGet package in VisualStudio.&amp;nbsp; Removing references and then using a different reference to the 2016 Microsoft SharePoint references seemed to fix the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 May 2019 12:41:07 GMT</pubDate>
    <dc:creator>BrianBulla</dc:creator>
    <dc:date>2019-05-13T12:41:07Z</dc:date>
    <item>
      <title>Weird Issue with onDeleteFeature event</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91535#M2399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've written an Editor Extension which has some code that runs when a feature is deleted.&amp;nbsp; Everything works 100% as needed, but today I decided to add a few lines of code to track some information in a Share Point List when a feature gets deleted.&amp;nbsp; As soon as I add that code, none of the code within my onDeleteFeature event fires.&amp;nbsp; It's like it doesn't even exists.&amp;nbsp; But....as soon as I comment out the code I added, everything works fine.&amp;nbsp; Really weird.&amp;nbsp; I don't know what the heck is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below.&amp;nbsp; The code below works, but as soon as I uncomment the commented out section, nothing works.&amp;nbsp; i don't even get the message box to pop up.&amp;nbsp; If I debug, nothing in this entire code block runs, but the delete still happens in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;        &lt;SPAN class="comment token"&gt;//When a feature is Deleted.&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Events_OnDeleteFeature&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ESRI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geodatabase&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IObject obj&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;obj &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; IFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                    &lt;SPAN class="comment token"&gt;//Cast to an IFeature&lt;/SPAN&gt;
                    IFeature inFeature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;obj&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 
                    ITable inTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; obj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Table&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inTable &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; IVersionedObject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                        IVersionedObject3 vObject &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IVersionedObject3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;inTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                        &lt;SPAN class="comment token"&gt;//Check if the Features Table is Versioned.  If not, then exit.&lt;/SPAN&gt;
                        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;vObject&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsRegisteredAsVersioned&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                            &lt;SPAN class="comment token"&gt;//Look for the Maximo field and edit.&lt;/SPAN&gt;
                            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindField&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MXCREATIONSTATE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                                MessageBox&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Show&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DELETE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//using (SPSite spSite = new SPSite("https://...."))&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//{&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//    using (SPWeb spWeb = spSite.OpenWeb())&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//    {&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        spWeb.AllowUnsafeUpdates = true;&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        SPList list = spWeb.Lists["GIS_Deletes"];&lt;/SPAN&gt;

                                &lt;SPAN class="comment token"&gt;//        //Add an item&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        SPListItem newItem = list.Items.Add();&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        newItem["MXASSETNUM"] = inFeature.Fields.FindField("MXASSETNUM").ToString();&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        newItem["MXSITEID"] = inFeature.Fields.FindField("MXSITEID").ToString();&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//        newItem.Update();&lt;/SPAN&gt;

                                &lt;SPAN class="comment token"&gt;//        spWeb.AllowUnsafeUpdates = false;&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//    }&lt;/SPAN&gt;
                                &lt;SPAN class="comment token"&gt;//}&lt;/SPAN&gt;
                            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;                                                            
                        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;                        
                    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt; ex&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                MessageBox&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Show&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ex&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Error in OnDeleteFeature procedure."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
            
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/S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/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:30:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91535#M2399</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2021-12-10T23:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Issue with onDeleteFeature event</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91536#M2400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know nothing about share point but just for a sanity check could you put say a write to a simple text file in place of that code, so you know that code is executing in that block? If that works suspicion falls upon you SPSite and&amp;nbsp;SPWeb objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2019 13:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91536#M2400</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2019-05-10T13:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Issue with onDeleteFeature event</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91537#M2401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It took a while but I eventually figured out that I was just using the wrong NuGet package in VisualStudio.&amp;nbsp; Removing references and then using a different reference to the 2016 Microsoft SharePoint references seemed to fix the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2019 12:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/weird-issue-with-ondeletefeature-event/m-p/91537#M2401</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2019-05-13T12:41:07Z</dc:date>
    </item>
  </channel>
</rss>

