Hi,
I have a use case where I have created a constraint in Delete trigger on ChildTable whether to allow that delete. I also have to update one column of the ParentTable from that same Delete trigger. But thats not happening.
I have multiple conditions for that calculation rule but to avoid confusion I wrote it in a simple way where I am updating the ParentTable's column "Field" on deleting ChildTable row.
return {
"edit": [{
"className": "ParentTable",
"updates": [{
"GlobalID": $feature.ParentTableId,
"Field": 1
}]
}]
}
On delete no error is coming but value of Field in ParentTable is also not updating to 1 when deleting ChildTable's row. Also ChildTable's constraint to delete row is working fine but the above attribute rule is not working
Mike,
I did see that here, but I'm struggling to figure out how/where to implement it...I'm pushing the limits of my knowledge.
I was able to figure this out with the $originalFeature. Again, I'm at my knowledge limits - please share any improvements that come to mind.
I modified the Update Related template and inserted the following into the get_feature_set() function
function get_feature_set(key) { var structures = FeatureSetByName($datastore, "Structure", ['OBJECTID', 'GlobalID', 'BM60'], false) var structuresSubset = Filter(structures, "ID = $feature.ID Or ID = $originalFeature.ID") return Decode( key, 'Structure_ConduitTest', structuresSubset, null ); }