Hello,
We have two feature classes A & B in enterprise geodatabase environment. They are participating in a relationship class.
A - Projects
B- Sewer upgrades
Our goal/requirement is to automatically update the common attributes on existing features in B if the same attribute fields are updates in A.
To accomplish this, base on the example available here, I came up with following (immediate calculation rule on A):
//s1 - get all the features from sewer upgrades feature class
var destination = FeatureSetByName($datastore, "GEO_DB.ENG_SD.SewerUpgrade", ["DBNUMBER","TECH_REV", "CONS_ST", "CONS_ED", "EST_CON_DUR", "STATUS"], false);
//s2 - get dbnumber edited in the projects developments feature class
var dbnumber = $feature.DBNUMBER;
//s3 - filter feature based on the existing edit
var match = Filter(destination, "DBNUMBER = @dbnumber");
//s4 - update records in sewer upgrades
var sewerupgradelist = [];
var counter = 0;
var numfeatures = Count(match);
if (numfeatures > 0) {
for (var feature in match) {
sewerupgradelist[counter] = {
'OBJECTID' : feature.OBJECTID,
'attributes' : {
'CONS_ST' : $feature.CONS_ST,
'CONS_ED' : $feature.CONS_ED,
'EST_CON_DUR' : $feature.EST_CONS_DUR,
'TECH_REV' : $feature.TECH_REV,
'STATUS' : $feature.STATUS
}
}
counter++
}
return {
'result' : numfeatures + ' sewer upgrades features found.',
'edit' : [{
'className' : "GEO_DB.ENG_SD.SewerUpgrade",
'updates' : sewerupgradelist
}]
}
}else {
return 'No features found under sewer upgrade with matching DBNUMBER.'
}
While there are no validation errors, ArcGIS Pro comes up with following error during testing:

Any help in resolving the issue will be appreciated.