Updating geometry of polygon feature class thru moving point feature class

431
2
02-09-2022 07:30 AM
Brian_McLeer
Occasional Contributor II

In using the workflow from this article from @HusseinNasser2 , when moving a point feature associated with a polygon, I receive the error in the image below. Does anyone have any insight? My environment is a SQL Database on Enterprise 10.8.1 and ArcGIS Pro 2.6.7. Also, we are upgrading I have tested on an Enterprise 10.9.1 and ArcGIS Pro 2.9.1 environment as well yielding the same results. 

 

Brian_McLeer_0-1644420323293.png

 

Attribute Rule Expression:

 

 

 

//The attribute rule is added to the pointClass on the Field field on update

//buffer the point feature 40 feet, this will give us a circle polygon geometry 
var bufferedGeometry = buffer($feature,0)
//get the guid of the point feature being updated
var AssetID = $feature.AssetID

//find the buffered geometry feature
var fs = FeatureSetbyName($datastore, "Database.Owner.ParkStructurePolygon")
//by filtering on the pointGuid
var bf = filter(fs, "AssetID = @AssetID")
//if we couldn't find it exit (someone might've deleted it)
if (count(bf) == 0) return $feature.AssetID;
//get the feature row (we should only have one )
var bufferedFeature = first(bf)

return {
      //we want to just return the value of field `Field` no change require
      "result": $feature.AssetID,
      //this keyword indicates an edit that need to happen, its an array since we can make many edits
       "edit": [
           {  
              //the other class we want to edit
               "className" : "Database.Owner.ParkStructurePolygon",
               //the type of edit, in this case we want to update so we say `updates`, its an array since we can make many updates
               "updates" : [
                      { 
                            //what feature we need to update? we can either find it by the globalid or the objectId
                            "globalID" : bufferedFeature.globalID,
                            //what do we want to update (we can optionally add attributes property and update properties there)
                            "geometry": bufferedGeometry,
                            "AssetID": $feature.AssetID,
                            "Comments": $feature.Comments,
                            "Description": $feature.Description 

                     }

             ]


            }    
     ]

}

 

 

 

 

Brian
Tags (1)
0 Kudos
2 Replies
Robert_LeClair
Esri Notable Contributor

By chance are you using a Query Layer or Database View for one of the point or polygon layers?  This could cause the issue you're seeing.

0 Kudos
Brian_McLeer
Occasional Contributor II

@Robert_LeClair I am not using either of those. Both tables are a point and polygon feature class. 

Brian
0 Kudos