I am using ArcPro/Fabric 3.4 in a geodatabase. When a parcel is made historic (and no longer exists in current) I want add that parcel number to a cancelled number table. My three use cases are as follows. Two work well but I can not get the third to work. Any help would be greatly appreciated.
1. If you set a Taxlot (our name for parcel) historic it should automatically update the cancelled number table. (this works)
2. If you duplicate a Taxlot and set it historic it will not update the cancelled number table. (this works)
3. If you merge two Taxlots and keep original features on so the "new" taxlot has the attributes of one of the parents then the cancelled number table should have one record in the cancelled number table for the taxlot that has been retired and no longer exists in current. . (this does not work - I get two records in the cancelled number table one record for both parents).
My code for the attribute rules (executes on update trigger, exclude for application eval, and trigger field is RetiredByRecord) is as follows:
// If a taxlot is set historic and no longer exists in current taxlots then the taxlot and maptaxlot are added to the cancelled number table.
var fsTaxlot = FeatureSetByName($datastore, "Taxlot ['MapTaxlot','RetiredByRecord','CreatedByRecord'],false)
var where = Concatenate(['MapTaxlot = ',"'", $feature.MapTaxlot,"'"," and RetiredByRecord is Null"])
var fsTaxlotFilter = filter(fsTaxlot,where)
var firstFilter = First(fsTaxlotFilter)
if (!isempty(firstFilter)) return
//if (!isempty(filter(fsTaxlot,where))) return
return {
"edit": [{
"className": "CancelledNumbers",
"adds": [{
'attributes':
{
"Taxlot": $feature.Taxlot,
"MapNumber":$feature.MapNumber
}
}]
}]
}