<?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 Create relationship class between two tables Pro sdk in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074859#M6824</link>
    <description>&lt;P&gt;Is there a way to create a relationship class between two TABLES with the pro sdk? Here is the code that I have used but the relationship class is not created in the geodatabase like I expect.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var originFc = gdb.OpenDataset&amp;lt;FeatureClass&amp;gt;(mmember.Name);
                    var destFc = gdb.OpenDataset&amp;lt;FeatureClass&amp;gt;(etTableName);
                    var oidname = originFc.GetDefinition().GetObjectIDField();
                    var origPrimaryKey = originFc.GetDefinition().GetFields().First(f =&amp;gt; string.Equals(oidname, f.Name));
                    var destForeignKey = destFc.GetDefinition().GetFields().First(f =&amp;gt; string.Equals(ETTableSchema.rowIDFieldName, f.Name));
                    var rlDesc = new VirtualRelationshipClassDescription(origPrimaryKey, destForeignKey,
                        RelationshipCardinality.OneToMany);
                    rlDesc.ForwardPathLabel = "HasEdits";
                    rlDesc.BackwardPathLabel = "AllObjects";
                    rlDesc.Name = $"{mmember.Name}_HTE";
                    var rlClass = originFc.RelateTo(destFc, rlDesc);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 18:30:15 GMT</pubDate>
    <dc:creator>MarvisKisakye1</dc:creator>
    <dc:date>2021-07-01T18:30:15Z</dc:date>
    <item>
      <title>Create relationship class between two tables Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074859#M6824</link>
      <description>&lt;P&gt;Is there a way to create a relationship class between two TABLES with the pro sdk? Here is the code that I have used but the relationship class is not created in the geodatabase like I expect.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/145101"&gt;@CharlesMacleod&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var originFc = gdb.OpenDataset&amp;lt;FeatureClass&amp;gt;(mmember.Name);
                    var destFc = gdb.OpenDataset&amp;lt;FeatureClass&amp;gt;(etTableName);
                    var oidname = originFc.GetDefinition().GetObjectIDField();
                    var origPrimaryKey = originFc.GetDefinition().GetFields().First(f =&amp;gt; string.Equals(oidname, f.Name));
                    var destForeignKey = destFc.GetDefinition().GetFields().First(f =&amp;gt; string.Equals(ETTableSchema.rowIDFieldName, f.Name));
                    var rlDesc = new VirtualRelationshipClassDescription(origPrimaryKey, destForeignKey,
                        RelationshipCardinality.OneToMany);
                    rlDesc.ForwardPathLabel = "HasEdits";
                    rlDesc.BackwardPathLabel = "AllObjects";
                    rlDesc.Name = $"{mmember.Name}_HTE";
                    var rlClass = originFc.RelateTo(destFc, rlDesc);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 18:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074859#M6824</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2021-07-01T18:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create relationship class between two tables Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074981#M6825</link>
      <description>&lt;P&gt;We started to add some data definition language (DDL) capabilities in the Pro SDK at 2.8, but you cannot yet create relationship classes (it's planned for a future release). &amp;nbsp;For now, you have to use the&amp;nbsp;geoprocessing API and use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-relationship-class.htm" target="_self"&gt;Create Relationship Class&lt;/A&gt; tool.&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 22:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074981#M6825</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2021-07-01T22:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create relationship class between two tables Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074989#M6826</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331236"&gt;@MarvisKisakye1&lt;/a&gt;&amp;nbsp;You probably already looked at this sample:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins" target="_blank"&gt;arcgis-pro-sdk-community-samples/Geodatabase/DynamicJoins at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, the sample only creates a 'dynamic' result (added to the TOC).&amp;nbsp; To create a relationship class in the geodatabase you have to follow Rich's suggestion.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 23:12:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-relationship-class-between-two-tables-pro/m-p/1074989#M6826</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-07-01T23:12:33Z</dc:date>
    </item>
  </channel>
</rss>

