<?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: Attribute Rule Updating Parent FC from Child Table Not Updating Field When Records Are Deleted in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1636934#M1834</link>
    <description>&lt;P&gt;I also have similar issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an attribute rule (trigger on Insert, Update, and Delete) on the MaximoLocation table that sets the maximolocationid field to null in the ElectricDevice feature class whenever a feature in MaximoLocation is deleted. Simultaneously, a calculation rule on the ElectricDevice feature class ensures that, on insert or update, the maximolocationid field is populated using the ID from the MaximoLocation table.&lt;/P&gt;&lt;P&gt;However, when I delete a feature from MaximoLocation, the rule isn’t clearing the corresponding maximolocationid value in ElectricDevice as expected. &lt;STRONG&gt;Why might this be happening?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To me it looks like, UpdateRule in &lt;STRONG&gt;ElectricDevice&lt;STRONG&gt; is again resetting the value from null to &lt;STRONG&gt;id&lt;STRONG&gt; from &lt;STRONG&gt;MaximoLocation, Can this be a reason?&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcPro Version: 3.3.1&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 15:44:27 GMT</pubDate>
    <dc:creator>RavindraSingh</dc:creator>
    <dc:date>2025-07-28T15:44:27Z</dc:date>
    <item>
      <title>Attribute Rule Updating Parent FC from Child Table Not Updating Field When Records Are Deleted</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1537513#M1575</link>
      <description>&lt;P&gt;I have created an attribute rule for an inspection table that will update a field in the parent feature class every time the table is updated. This rule is set to run on the 'insert', 'update', and 'delete' triggers. However, it only functions properly for the 'insert' and 'update' triggers. If I delete a row from the inspection table, the rule will not re-calculate the 'date' field and will instead retain the date of the recently deleted row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had thought that this code was simple enough that it would just re-calculate the date field regardless of what edit actions are being performed and would keep that field up to date as a result. Any ideas why the delete action is not re-calculating the rule in the same way? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// filter the parent class for only related features
        
var parent_id = $feature.GUID;
var parent_class = FeatureSetByName($datastore, "Parent_FeatureClass", ["GlobalID", "Date"], false);
var parent_match = Filter(parent_class, "GlobalID = @parent_id");
        
// return null if no matches are found
        
var cnt = Count(parent_match);
        
if (cnt == 0) {
return null
}; 
        
// else, order inspection records by most recent to oldest entries and retain most recent record
        
var tabledata = FeatureSetByName($datastore, "Inspection_Table");
var ordered_dates = OrderBy(tabledata, "Date DESC");
var relatedinfo = "";
var info = First(ordered_dates);
relatedinfo = info.Date;  
        
// update parent table field with most recent record data
        
return {
        "result" : $feature.GUID,
        "edit": [
        {
        "className" : "Parent_FeatureClass",
        "updates": [
        {"globalID" : parent_id, 
        "attributes":
        {
        "Date" : relatedinfo
        }
        }
        ]
        }
        ]
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 19:48:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1537513#M1575</guid>
      <dc:creator>KarynaB</dc:creator>
      <dc:date>2024-09-11T19:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Parent FC from Child Table Not Updating Field When Records Are Deleted</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1537829#M1576</link>
      <description>&lt;P&gt;I partially figured out the errors in my above code and attempted to fix them with an additional if statement that matches the original feature's guid with the parent class' global id. However, I am receiving an error when trying to update the relationship (error: Missing keyword 'objectID or globalID' in the 'updates' array or dictionary). Any ideas where I went wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// filter the parent class for only related features
    
var originalguid = $originalfeature.GUID
var parent_id = $feature.GUID;
var parent_class = FeatureSetByName($datastore, "Parent_FeatureClass", ["GlobalID", "Date"], false);
var parent_match = Filter(parent_class, "GlobalID = @parent_id");
                
    
// return null if no matches are found
            
if(parent_match == null)  { 
return {
    "result" : null,
    "edit": [
        {"className" : "Parent_FeatureClass",
        "updates": [
            {"globalID" : originalguid, 
            "attributes":
            {"Date" : null}
            }
        ]
        }
    ]
}
};
        
            
// else, order inspection records by most recent to oldest entries and retain most recent record
            
var tabledata = FeatureSetByName($datastore, "Inspection_Table");
var ordered_dates = OrderBy(tabledata, "Date DESC");
var info = First(ordered_dates);
var relatedinfo = info.Date;  
           
     
// update parent table field with most recent record data
    
if(parent_match != null) {
    return {
            "result" : $feature.GUID,
            "edit": [
            {"className" : "Parent_FeatureClass",
        "updates": [
            {"globalID" : parent_id, 
            "attributes":
            {"Date" : relatedinfo}
            }
            ]
            }
            ]
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 15:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1537829#M1576</guid>
      <dc:creator>KarynaB</dc:creator>
      <dc:date>2024-09-12T15:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Parent FC from Child Table Not Updating Field When Records Are Deleted</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1632003#M1808</link>
      <description>&lt;P&gt;Did you ever figure out how to recalculate when you delete a related record?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 14:30:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1632003#M1808</guid>
      <dc:creator>BrettLessner_Nsight</dc:creator>
      <dc:date>2025-07-10T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule Updating Parent FC from Child Table Not Updating Field When Records Are Deleted</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1636934#M1834</link>
      <description>&lt;P&gt;I also have similar issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an attribute rule (trigger on Insert, Update, and Delete) on the MaximoLocation table that sets the maximolocationid field to null in the ElectricDevice feature class whenever a feature in MaximoLocation is deleted. Simultaneously, a calculation rule on the ElectricDevice feature class ensures that, on insert or update, the maximolocationid field is populated using the ID from the MaximoLocation table.&lt;/P&gt;&lt;P&gt;However, when I delete a feature from MaximoLocation, the rule isn’t clearing the corresponding maximolocationid value in ElectricDevice as expected. &lt;STRONG&gt;Why might this be happening?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To me it looks like, UpdateRule in &lt;STRONG&gt;ElectricDevice&lt;STRONG&gt; is again resetting the value from null to &lt;STRONG&gt;id&lt;STRONG&gt; from &lt;STRONG&gt;MaximoLocation, Can this be a reason?&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcPro Version: 3.3.1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 15:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-updating-parent-fc-from-child-table/m-p/1636934#M1834</guid>
      <dc:creator>RavindraSingh</dc:creator>
      <dc:date>2025-07-28T15:44:27Z</dc:date>
    </item>
  </channel>
</rss>

