A requested row object could not be located-Attribute rule for calculating and update value on relationshipclass.

184
2
05-14-2024 08:25 AM
anilkumar
New Contributor II

Hello all- I am working to set up our attribute rules. I would like to create a rule that will copy edited row of a feature class to another feature class when there is a status change from Attribute values.  am following this error based on code provided in the forum: EW is relationshipclass maintaining parent GLOBALID(as CGUID) and comparing anc evaluating new lstatus

 

var globalId = $feature.globalid
var lstatus = $feature.LSTATUS;
var tableToUpdate = "EW";
var returnField1 = "GLOBALID";
var returnField2 = "globalid"
var fs = FeatureSetByName($datastore, "EW", [returnField1, returnField2], false);
var feats = Filter(fs,'CGUID = @globalId');
if(feats == null || Count(feats) == 0) {
return $feature.comments;
}
else{
for(var feat in feats){
var updateDict = {'GlobalID': feat.globalid, 'attributes': {}};
updateDict['attributes'] ['lstatus'] = lstatus;
var updateList = [updateDict];
var editDict = {'className': tableToUpdate, 'updates': updateList};
var editList = [editDict];
var returnDict = {'edit': editList};
return returnDict;
}
}
return $feature.comments;

 

I am getting an error "

Update table row : EL
update table row failed.
A requested row object could not be located.
Rule Name : AR23
Triggering Event Update

ClassName: EL,
GlobalID :{XX--xx}"

0 Kudos
2 Replies
HusseinNasser2
Esri Contributor

The error essentially say you tried to update a feature that doesn't exist. So we need to debug to see what the rule is passing.. 

I see you are using 2.9.10, is it possible to move to 2.9.12?  we included many fixes for attribute rules and relationships there plus we also included the ability to print the console output to the debug diagnostics in Pro. 

 

I included the updated rule with few changes.. 

Run the rule while ArcGIS Pro monitor is running (debug mode) (CTRL+ALT+M), and look for the console output , I added **** to make searching easy, see what output you get, this will tell us more. 

 

var globalId = $feature.globalid
var lstatus = $feature.LSTATUS;
var tableToUpdate = "EW"; 

var fs = FeatureSetByName($datastore, "EW", ["globalid"], false);
var feats = Filter(fs,'CGUID = @globalId');


var editDict = {'className': tableToUpdate, 'updates': []};

var updateCount = 0;
var updateList = [];

for(var feat in feats)
{
    var updateDict = {'GlobalID': feat.globalid, 'attributes': {"lstatus": lstatus}};
    updateList[updateCount++] = updateDict
 }
//if no matches simply return. 
if (updateCount == 0) $feature.comments;

editDict[updates] = updateList;
//print out 
console("******" + text(editDict))
return {'edit': editList};
 

 

 

0 Kudos
anilkumar
New Contributor II

Thank you for the details.

anilkumar_0-1715721018279.png

currently am receiving an error message 'object not found updates' . As per your code, not wanting to update GLOBALID( here in child (relationship class ) which is CGUID. CGUID is mtaching with Parent GlobalID already. Only need to update lstatus as updated the records related to parent.

 

0 Kudos