Select to view content in your preferred language

FeatureSetByRelationshipName Attribute Rule Error

976
4
Jump to solution
05-31-2023 10:12 AM
Chip727
Emerging Contributor

I'm trying to setup an attribute rule in ArcGIS Pro 10.9.1 that evaluates two GUID fields, crby_fpt_rel and crby_far_rel, in a sample point feature class for Null values. If both fields are Null, I would like Null to be returned. If either field is not Null, I would like to use the FeatureSetByRelationshipName function to pull the ft_alias from the parent feature class into the corresponding field. The sample point feature class is the child of two parent feature classes, feature_area and feature_point. The feature_area feature class is related (1:M) to the sample_point feature class using globalid/crby_far_rel; the feature point feature class is related (1:M) to the sample_point feature class using globalid/crby_fpt_rel.

The feature classes are all in the same EGDB. They are published to Portal as registered feature services, and used in Field Maps.

This is the script I built for use in the attribute rules for the ft_alias field. However, I'm receiving an error in Pro asking for an array or featureset for line 10 (var far = First(relarea)) or I get a 999999 error code. Additionally, Field Maps fails to submit sample points to the child feature class when the attribute rule is enabled.

var areaatt = $feature["crby_far_rel"];
var ptatt = $feature["crby_fpt_rel"];
var relin = "";

 

if ((IsEmpty(ptatt)) && (IsEmpty(areaatt))){
    relin = Null;
} else if (!IsEmpty(areaatt)){
   var relarea = FeatureSetByRelationshipName($feature,"EGDBName.DBOName.RelationshipName", ["*"]);
   var far = First(relarea);
   relin = far.ft_alias;
} else if (!IsEmpty(ptatt)){
   var relpt = FeatureSetByRelationshipName($feature,"EGDB.DBOName.RelationshipName", ["*"]);
   var fpt = First(relpt);
   relin = fpt.ft_alias;
} return relin

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor

Hey @Chip727 

Can you try to Exclude the rule from client evaluation and confirm if the error goes away?   

Make sure this option is checked. 

HusseinNasser2_0-1686255149212.png

 

View solution in original post

0 Kudos
4 Replies
MikeMillerGIS
Esri Frequent Contributor
Are you edit done in ArcGIS Pro? Could it be the edit cache saving the edits till a certain time?
0 Kudos
Chip727
Emerging Contributor

Thank you for the response. I am using this in ArcGIS Pro. I'm not certain what you mean by the edit cache, but the attribute rule is set to trigger at insert. I still get the 999999  and 002717 errors despite how I set the trigger, insert or update.

0 Kudos
HusseinNasser2
Esri Contributor

Hey @Chip727 

Can you try to Exclude the rule from client evaluation and confirm if the error goes away?   

Make sure this option is checked. 

HusseinNasser2_0-1686255149212.png

 

0 Kudos
Chip727
Emerging Contributor

@HusseinNasser2 This worked! The attribute rule is now working when data is submitted from Field Maps. Thank you!

0 Kudos