<?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>idea Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET in ArcGIS Pro SDK Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idi-p/1344272</link>
    <description>&lt;P&gt;I'm trying to create a new Layer from a table which is the result of a join between a FeatureClass and a table. I used the following example as a basis (specifically the "MakeJoin"-Function from "JoinsDockPaneViewModel.cs"):&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The FeatureClass comes from a file geodatabase, the table from a postgreSQL database that is not an enterprise geodatabase. My code looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private RelationshipClass MakeJoin(RelationshipClass relationshipClass, Table leftTable, Table rightTable, Field leftField, Field rightField, string layername)
{
    VirtualRelationshipClassDescription virtualRelationshipClassDescription = new VirtualRelationshipClassDescription(leftField, rightField, RelationshipCardinality.OneToOne);
    relationshipClass = leftTable.RelateTo(rightTable, virtualRelationshipClassDescription);
    JoinDescription joinDescription = new JoinDescription(relationshipClass)
    {
        JoinDirection = JoinDirection.Forward,
        JoinType = JoinType.InnerJoin,
        TargetFields = leftTable.GetDefinition().GetFields()
    };

    Join join = new Join(joinDescription);
    Table joinedTable = join.GetJoinedTable();
    if (joinedTable is FeatureClass)
    {
        FeatureClass joinedFc = (FeatureClass) joinedTable;

        FeatureLayerCreationParams layerParams = new FeatureLayerCreationParams(joinedFc);
        LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(layerParams, MapView.Active.Map);
    } 
    return relationshipClass;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At line 19 (CreateLayer) the following Exception occurs:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;A user-supplied component or subscriber raised an exception (0x80040208)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;System.ArgumentException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Quelle: ArcGIS.Desktop.Mapping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;TargetSite: T MakeBasicServiceCall[T](System.Func`1[T])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Stack:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.Mapping.Utilities.MakeBasicServiceCall[T](Func`1 serviceCall)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerCreationParams.CreateFromDataConnection(ILayerContainerEdit mapOrGroupLayer, Int32 index)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerCreationParams.CreateLayer(ILayerContainerEdit mapOrGroupLayer, Int32 layerIndex)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerFactory.CreateLayer[T](LayerCreationParams layerParams, ILayerContainerEdit container)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;InnerException:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;A user-supplied component or subscriber raised an exception (0x80040208)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;System.Runtime.InteropServices.COMException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Quelle: ArcGIS.Desktop.Mapping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;TargetSite: System.String AddData(ArcGIS.Desktop.Internal.Mapping.CreateLayerArgs ByRef, System.String)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Stack:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.DesktopService._IMapAuthoringService.AddData(CreateLayerArgs&amp;amp; args, String dataConnectionXml)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.Map.&amp;lt;&amp;gt;c__DisplayClass316_0.&amp;lt;AddData&amp;gt;b__0()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.Mapping.Utilities.MakeBasicServiceCall[T](Func`1 serviceCall)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The exception doesn't occur when I use two FeatureClasses to create the join. The only workaround for this is the use of the Geoprocessing tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I have already posted this as a question in the community area, but there is no answer up to now:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-new-layer-from-joined-table-throws-system/m-p/1272337#M9577" target="_blank" rel="noopener"&gt;Creating new Layer from joined table throws System... - Esri Community&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I was informed via a technical support case that the ArcGIS Pro SDK does not currently support databases that are not configured as a geodatabase for joins.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I was referred to Esri Ideas, that's why I'm suggesting this here.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 06:53:25 GMT</pubDate>
    <dc:creator>JFr87</dc:creator>
    <dc:date>2023-11-01T06:53:25Z</dc:date>
    <item>
      <title>Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idi-p/1344272</link>
      <description>&lt;P&gt;I'm trying to create a new Layer from a table which is the result of a join between a FeatureClass and a table. I used the following example as a basis (specifically the "MakeJoin"-Function from "JoinsDockPaneViewModel.cs"):&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The FeatureClass comes from a file geodatabase, the table from a postgreSQL database that is not an enterprise geodatabase. My code looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private RelationshipClass MakeJoin(RelationshipClass relationshipClass, Table leftTable, Table rightTable, Field leftField, Field rightField, string layername)
{
    VirtualRelationshipClassDescription virtualRelationshipClassDescription = new VirtualRelationshipClassDescription(leftField, rightField, RelationshipCardinality.OneToOne);
    relationshipClass = leftTable.RelateTo(rightTable, virtualRelationshipClassDescription);
    JoinDescription joinDescription = new JoinDescription(relationshipClass)
    {
        JoinDirection = JoinDirection.Forward,
        JoinType = JoinType.InnerJoin,
        TargetFields = leftTable.GetDefinition().GetFields()
    };

    Join join = new Join(joinDescription);
    Table joinedTable = join.GetJoinedTable();
    if (joinedTable is FeatureClass)
    {
        FeatureClass joinedFc = (FeatureClass) joinedTable;

        FeatureLayerCreationParams layerParams = new FeatureLayerCreationParams(joinedFc);
        LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(layerParams, MapView.Active.Map);
    } 
    return relationshipClass;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At line 19 (CreateLayer) the following Exception occurs:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;A user-supplied component or subscriber raised an exception (0x80040208)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;System.ArgumentException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Quelle: ArcGIS.Desktop.Mapping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;TargetSite: T MakeBasicServiceCall[T](System.Func`1[T])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Stack:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.Mapping.Utilities.MakeBasicServiceCall[T](Func`1 serviceCall)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerCreationParams.CreateFromDataConnection(ILayerContainerEdit mapOrGroupLayer, Int32 index)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerCreationParams.CreateLayer(ILayerContainerEdit mapOrGroupLayer, Int32 layerIndex)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.LayerFactory.CreateLayer[T](LayerCreationParams layerParams, ILayerContainerEdit container)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;InnerException:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;A user-supplied component or subscriber raised an exception (0x80040208)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;System.Runtime.InteropServices.COMException&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Quelle: ArcGIS.Desktop.Mapping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;TargetSite: System.String AddData(ArcGIS.Desktop.Internal.Mapping.CreateLayerArgs ByRef, System.String)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Stack:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.DesktopService._IMapAuthoringService.AddData(CreateLayerArgs&amp;amp; args, String dataConnectionXml)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Mapping.Map.&amp;lt;&amp;gt;c__DisplayClass316_0.&amp;lt;AddData&amp;gt;b__0()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at ArcGIS.Desktop.Internal.Mapping.Utilities.MakeBasicServiceCall[T](Func`1 serviceCall)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The exception doesn't occur when I use two FeatureClasses to create the join. The only workaround for this is the use of the Geoprocessing tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I have already posted this as a question in the community area, but there is no answer up to now:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-new-layer-from-joined-table-throws-system/m-p/1272337#M9577" target="_blank" rel="noopener"&gt;Creating new Layer from joined table throws System... - Esri Community&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I was informed via a technical support case that the ArcGIS Pro SDK does not currently support databases that are not configured as a geodatabase for joins.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I was referred to Esri Ideas, that's why I'm suggesting this here.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 06:53:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idi-p/1344272</guid>
      <dc:creator>JFr87</dc:creator>
      <dc:date>2023-11-01T06:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344425#M12</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/483105"&gt;@JFr87&lt;/a&gt;&amp;nbsp;You should be able to Run the AddJoin tool through the .sdk using this example.&amp;nbsp; Does this help?&lt;BR /&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/GeoprocessingExecuteAsync" target="_blank"&gt;arcgis-pro-sdk-community-samples/Geoprocessing/GeoprocessingExecuteAsync at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344425#M12</guid>
      <dc:creator>JonathanNeal</dc:creator>
      <dc:date>2023-11-01T15:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET - Status changed to: Under Consideration</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344776#M13</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/483105"&gt;@JFr87&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reporting this. It appears to be a bug as of now to us. We are investigating this and get back here with updates when we find more.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 23:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344776#M13</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2023-11-01T23:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344835#M14</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/342593"&gt;@JonathanNeal&lt;/a&gt;Thanks for the suggestion. I already tried that and yes, it's a workaround for the time being. &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I would still prefer if I could achieve my goal like in the example above.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 06:56:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1344835#M14</guid>
      <dc:creator>JFr87</dc:creator>
      <dc:date>2023-11-02T06:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET - Status changed to: In Product Plan</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1413215#M134</link>
      <description />
      <pubDate>Sun, 21 Apr 2024 18:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1413215#M134</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2024-04-21T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new Layer from joined table with the ArcGIS Pro .SDK for .NET - Status changed to: Implemented</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1425593#M137</link>
      <description>&lt;P&gt;Implemented in ArcGIS Pro 3.3.&lt;/P&gt;&lt;P&gt;Thank your for reporting this.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 21:55:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-ideas/creating-new-layer-from-joined-table-with-the/idc-p/1425593#M137</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2024-05-09T21:55:36Z</dc:date>
    </item>
  </channel>
</rss>

