Hi.
I'm struggeling with an attribute rule (Calculation) in ArcGIS Pro. I have a two featureclasses in a filegeodatabase (Vegteig - polygon, Tilknytningspunkt - point). The polygonclass has an ID (Teig_ID) which is used as a foreign key in the point class. When I delete a polygon, I want the corresponding point to be deleted as well. I've created an attribute rule on the polygonclass which triggers on delete and have turned on "exclude from application evaluation".
// henter teig_id fra tilknytningspunkt som slettes
var teig_id = $feature.Teig_ID
var fs_tilknytningspunkter = FeatureSetByName($datastore, "Tilknytningspunkter", ["GlobalID", "TEIG_ID"])
var tilknytningspunkt = First(Filter(fs_tilknytningspunkter, "TEIG_ID=@teig_id"))
Console(tilknytningspunkt)
var deleteList = []
if(tilknytningspunkt == null){
return
}
else{
var delete = {'globalId': tilknytningspunkt.GlobalID}
Push(deleteList, delete)
}
Console(deleteList)
return
{
'edit': [{
'className': 'Tilknytningspunkter',
'deletes': deleteList
}]
}This code seems to be working fine, as it's verified ok and I can see that point is being selected in the output to console. The problem is that the delete it self is not executed. The polygon is deleted, but the poit still remains.
Can anyone see what's wrong?