<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Arcade and editing M-N relation class in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/arcade-and-editing-m-n-relation-class/m-p/1197335#M489</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Arcgis pro 2.9, Arcgis server 10.9.1, Enterprise geodatabase (PG), using globalID, no branch versioning.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The relation class is "cable_pole".&amp;nbsp; I have a "log" table for various messages too.&lt;/P&gt;&lt;P&gt;To do that, I try to edit with "adds" or "deletes" cable_pole.&lt;/P&gt;&lt;P&gt;I encounter 2 problems :&lt;/P&gt;&lt;P&gt;1) To delete records in cable_pole, I've this snippet of code&lt;/P&gt;&lt;P&gt;var pole_id = $feature["pole_id"]&lt;BR /&gt;var fsRel = Filter(FeatureSetByName($datastore, "lighting.ep.cable_pole"), "pole_id = @pole_id")&lt;/P&gt;&lt;P&gt;but it's impossible to save the rule : 001841: The table was not found. [lighting.ep.cable_pole]&lt;/P&gt;&lt;P&gt;2) When adding with&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;&amp;nbsp; 'edit': [{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'className': 'lighting.ep.cable_pole',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'adds': add&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'className': 'lighting.ep.log',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'adds': [{attributes : {'text' : "add relation"}}]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;nothing is added in cable_pole, no error message, and "add relation" is well added in my log table.&lt;/P&gt;&lt;P&gt;Transposing my whole Arcade code to a geodatabase file copy works perfectly.&lt;/P&gt;&lt;P&gt;So, can anyone help me manage the relations in Enterprise geodatabase with Arcade attribute rule ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Jean-Luc&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 13:28:33 GMT</pubDate>
    <dc:creator>Jean-LucDaems</dc:creator>
    <dc:date>2022-07-29T13:28:33Z</dc:date>
    <item>
      <title>Arcade and editing M-N relation class</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-and-editing-m-n-relation-class/m-p/1197335#M489</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Arcgis pro 2.9, Arcgis server 10.9.1, Enterprise geodatabase (PG), using globalID, no branch versioning.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The relation class is "cable_pole".&amp;nbsp; I have a "log" table for various messages too.&lt;/P&gt;&lt;P&gt;To do that, I try to edit with "adds" or "deletes" cable_pole.&lt;/P&gt;&lt;P&gt;I encounter 2 problems :&lt;/P&gt;&lt;P&gt;1) To delete records in cable_pole, I've this snippet of code&lt;/P&gt;&lt;P&gt;var pole_id = $feature["pole_id"]&lt;BR /&gt;var fsRel = Filter(FeatureSetByName($datastore, "lighting.ep.cable_pole"), "pole_id = @pole_id")&lt;/P&gt;&lt;P&gt;but it's impossible to save the rule : 001841: The table was not found. [lighting.ep.cable_pole]&lt;/P&gt;&lt;P&gt;2) When adding with&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;&amp;nbsp; 'edit': [{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'className': 'lighting.ep.cable_pole',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'adds': add&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'className': 'lighting.ep.log',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'adds': [{attributes : {'text' : "add relation"}}]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;nothing is added in cable_pole, no error message, and "add relation" is well added in my log table.&lt;/P&gt;&lt;P&gt;Transposing my whole Arcade code to a geodatabase file copy works perfectly.&lt;/P&gt;&lt;P&gt;So, can anyone help me manage the relations in Enterprise geodatabase with Arcade attribute rule ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Jean-Luc&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 13:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-and-editing-m-n-relation-class/m-p/1197335#M489</guid>
      <dc:creator>Jean-LucDaems</dc:creator>
      <dc:date>2022-07-29T13:28:33Z</dc:date>
    </item>
  </channel>
</rss>

