At ArcGIS Pro 3.1 there are changes in attribute rules to improve performance with how features are queried across feature classes. When requesting a FeatureSet you can specify which fields should be returned and this can improve performance. This option was available in previous versions, but prior 3.1 if you were in an edit session all fields were returned regardless of what you requested in the FeatureSet. At 3.1 this behavior was changed and now only requested fields are returned.
Some of the rules included in the Address Data Management solution at version 2.0 did not request all the necessary fields used later in the rule. As a result you will receive errors at 3.1 for rules that previously ran successfully at 3.0 or 2.9. For example when constructing a new road and splitting an existing road you will get error "Arcade error: Field not found centerlineid, Script line: 47".
We will be releasing an update to the Address Data Management solution in March that will address these issues. However, if you have already implemented the solution it will be easier to update the rules on your existing feature classes. Below I describe the 3 feature classes and 5 attribute rules that need to be updated. All of these changes will also continue to work at Pro 2.9 and 3.0, so you can make these changes now in preparation for 3.1. For more information on how to edit attribute rules, see Create and manage attribute rules in the ArcGIS Pro help.
RoadCenterline: 'Update Site Addresses' calculation rule
On line 62 of the rule (line 2 in the snippet below) add "globalid" to the list of returned fields.
var updates = []
var siteAddresses = Filter(FeatureSetByName($datastore, "SiteAddressPoint", [addressfullname_field, addrnum_field, municipality_field, "globalid"], false), addressfullname_field + " = @origFullName");
var globalid_field = Schema(siteAddresses).globalIdField;
RoadCenterline: 'Update Validation Status' calculation rule
On line 43 of the rule (line 2 in the snippet below) add id_field, munileft_field, and muniright_field to the list of returned fields. Update To:
var search_string = id_field + " IN @ids" + " OR " + fullname_field + " = @fullname" + " OR " + fullname_field + " = @fullname_orig"
var roadCenterlines = Filter(FeatureSetByName($datastore, "RoadCenterline", ["objectid", id_field, munileft_field, muniright_field], false), search_string)
var road_objectIDs = [];
RoadCenterline: 'Address Range Overlap' validation rule
On line 31 and 44 of the rule (line 4 and 17 in the snippet below) add "globalid" to the list of returned fields.
// Find any roads were the range overlap on the left side and get their IDs
if (!IsEmpty(fromLeft) && !IsEmpty(toLeft) && (fromLeft != 0 || toLeft != 0)) {
var search_string = fullname_field + " = @fullname" + " AND " + fromleft_field + " <= @toLeft" + " AND " + toleft_field + " >= @fromLeft";
var leftRoadCenterlines = Filter(FeatureSetByName($datastore, "RoadCenterline", [fullname_field, fromleft_field, toleft_field, munileft_field, id_field, "globalid"], false), search_string)
for (var road in leftRoadCenterlines) {
// Test that the road is not the same as the feature, that it either is in the same municipality or intersects the feature, and that it has not already been added to the ids array
if (road.globalid != $feature.globalid && (road[munileft_field] == munileft || Intersects(road, $feature)) && !Includes(ids, road[id_field])) {
Push(ids, road[id_field]);
}
}
}
// Find any roads were the range overlap on the right side and get their IDs
if (!IsEmpty(fromRight) && !IsEmpty(toRight) && (fromRight != 0 || toRight != 0)) {
var search_string = fullname_field + " = @fullname" + " AND " + fromright_field + " <= @toRight" + " AND " + toright_field + " >= @fromRight";
var rightRoadCenterlines = Filter(FeatureSetByName($datastore, "RoadCenterline", [fullname_field, fromright_field, toright_field, muniright_field, id_field, "globalid"], false), search_string)
for (var road in rightRoadCenterlines) {
// Test that the road is not the same as the feature, that it either is in the same municipality or intersects the feature, and that it has not already been added to the ids array
if (road.globalid != $feature.globalid && (road[muniright_field] == muniright || Intersects(road, $feature)) && !Includes(ids, road[id_field])) {
Push(ids, road[id_field]);
}
}
}
SiteAddressPoint: 'Postal Address' calculation rule
On line 48 of the rule (line 2 in the snippet below) add "globalid" to the list of returned fields.
// Get the related postal addresses
var postalAddresses = Filter(FeatureSetByName($datastore, "PostalAddress", [pstlcity_field, pstlstatus_field, represent_field, "globalid"], false), siteaddid_field + " = @ID");
for (var pstladdress in postalAddresses) {
PostalAddress: 'Postal Address' calculation rule
On line 30 of the rule (line 2 in the snippet below) add municipality_field, stateabbreviation_field, and status_field to the list of returned fields.
// Get the related site addresses, if there are no related records return
var siteAddresses = Filter(FeatureSetByName($datastore, "SiteAddressPoint", [fulladdr_field, municipality_field, stateabbreviation_field, status_field], false), id_field + " = @siteaddid");
if (Count(siteAddresses) == 0) return;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.