Arcade and editing M-N relation class

07-29-2022 06:28 AM
New Contributor


Arcgis pro 2.9, Arcgis server 10.9.1, Enterprise geodatabase (PG), using globalID, no branch versioning.

I want to manage and edit (add or delete) the relations (M-N) between 2 entity classes (let's say "cable" and "pole") within an Arcade calculation attribute rule : when pole is created next to cable, I want to add relation between these objects, and when pole is moved far from cable, i want to delete the relation.

The relation class is "cable_pole".  I have a "log" table for various messages too.

To do that, I try to edit with "adds" or "deletes" cable_pole.

I encounter 2 problems :

1) To delete records in cable_pole, I've this snippet of code

var pole_id = $feature["pole_id"]
var fsRel = Filter(FeatureSetByName($datastore, "lighting.ep.cable_pole"), "pole_id = @pole_id")

but it's impossible to save the rule : 001841: The table was not found. [lighting.ep.cable_pole]

2) When adding with

return {
  'edit': [{
      'className': 'lighting.ep.cable_pole',
      'adds': add
     'className': 'lighting.ep.log',
     'adds': [{attributes : {'text' : "add relation"}}]

nothing is added in cable_pole, no error message, and "add relation" is well added in my log table.

Transposing my whole Arcade code to a geodatabase file copy works perfectly.

So, can anyone help me manage the relations in Enterprise geodatabase with Arcade attribute rule ?

Thanks in advance,


0 Kudos
0 Replies