AnsweredAssumed Answered

Attribute Rules and editing via Feature service with branch versioning

Question asked by fsheagle-co-nz-esridist Employee on Oct 29, 2019
Latest reply on Oct 29, 2019 by fsheagle-co-nz-esridist


I have a feature class with calculation attribute rules set up. The rule works out an attribute based on an intersection with another feature class. The feature class is versioned (BV) and published as a web layer with feature access and version management. It is the only feature class in the service. I have a rule like this:


var fsOwnership = FeatureSetByName($datastore,"GIS.GISADMIN.Ownership",["propertyid"],true);
var fsOwnershipInts = Intersects(fsOwnership , Geometry($feature));
var ownership = First(fsOwnershipInts);
return 999;
return 999;
return ownership.propertyid;

this rule is set for insert and update.


When editing via the feature service in ArcGIS Pro, the rule fires correctly on an insert - but DOESN'T on an update. On an update it does this:



so it can find it for an insert but not an update?

has anyone seen this? ArcGIS Enterprise 10.7.1 with SQL Server back end.





the help does say 

The map or feature service containing one or more layers from which to create a FeatureSet. Typically, this value is the $map or $datastore global.

which suggests it expects the layer to be in the FS. We can't do this as the other feature class isn't versioned and doesn't fit with the publishing strategy. And it also doesn't explain why it's working for the insert. trying $map doesn't work with ArcGIS Pro


Sorry - should have also mentioned worked as expected via direct db connection before branch versioning.


Gets stranger - when you look at the rules in pro via design from the database connection you see


var fsOwnership = FeatureSetByName($datastore,"GIS.GISADMIN.Ownership",["propertyid"],true);


var featureSet=FeatureSetByName($datastore,"GIS.GISADMIN.Resource", ["GlobalID","IsActive"], true);


if you add the feature service to the map and do design you see

var fsOwnership = FeatureSetByName($datastore,"{8CC3904F-4B31-4B74-98F4-9ECF13DE8F72}",["propertyid"],true);


var featureSet=FeatureSetByName($datastore,"L0Resource", ["GlobalID","IsActive"], true);


The first is the ID of the layer in the gdb items table. Don't know where it got the second from....