I am trying to set up an attribute rule that is triggered by an update to the Parent Property ID. As it currently stands it does recalculate the GIS_Property Acres for the record modified, but it doesn't update other related records that share the same Parent Property ID. I have a similar attribute rule that does the same thing if the geometry is changed, and it works perfectly. Thanks for any help that anyone can give!
var new_parent_property_id = $feature.ParentPropertyID
var old_parent_property_id = $originalfeature.ParentPropertyID
if(new_parent_property_id != old_parent_property_id){
//Creates empty array and counter for iterating
var updates = []
var counter = 0
var gid = $feature.GlobalId
var id = $feature.ParentPropertyID
//use this filter statement to get all of them for the SUM.
var sumfs = Filter($featureset, "ParentPropertyID = <a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972">@ID</a>")
var property_acres = Sum(sumfs, "GIS_TractAcres")
var fs = Filter($featureset, "ParentPropertyID = <a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972">@ID</a> AND GlobalId <> @gid")
for (var f in fs){
updates[counter] = {
'globalid': f.GlobalId,
'attributes':{
'GIS_PropertyAcres': property_acres,
}
}
counter++
}
return {
'edit': [{
'className': 'Arcade_Rules_Test',
'updates': updates
}],
'result': {
"attributes": {
"GIS_PropertyAcres": property_acres
}
}
}
}
else {
return 999
}