<?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 Add records to related table in ArcGIS Runtime SDK for .NET WPF in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317779#M3717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using ArcGIS runtime SDK for .NET V100.5 to develop a WPF application. The application’s feature layer has a related table and attachment enabled, so it has 2 relationship classes. For attachments, I have no problem because&amp;nbsp;ESRI&amp;nbsp;is&amp;nbsp;providing several API to read/write them. But for the other related table, I created a table first and then a relationship class between this table and my application’s feature layer (My app has only one editable feature layer.) &amp;nbsp;My app needs to be able to read and write the table. I find some samples which show how to retrieve(read) data from related table, but cannot find&amp;nbsp;the one&amp;nbsp;which show how to write data into the related table. I am wondering if a related table is not able to be written? If it can be, how to do it? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Saili&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2020 01:30:17 GMT</pubDate>
    <dc:creator>SailiTang1</dc:creator>
    <dc:date>2020-09-29T01:30:17Z</dc:date>
    <item>
      <title>Add records to related table in ArcGIS Runtime SDK for .NET WPF</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317779#M3717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using ArcGIS runtime SDK for .NET V100.5 to develop a WPF application. The application’s feature layer has a related table and attachment enabled, so it has 2 relationship classes. For attachments, I have no problem because&amp;nbsp;ESRI&amp;nbsp;is&amp;nbsp;providing several API to read/write them. But for the other related table, I created a table first and then a relationship class between this table and my application’s feature layer (My app has only one editable feature layer.) &amp;nbsp;My app needs to be able to read and write the table. I find some samples which show how to retrieve(read) data from related table, but cannot find&amp;nbsp;the one&amp;nbsp;which show how to write data into the related table. I am wondering if a related table is not able to be written? If it can be, how to do it? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Saili&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:30:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317779#M3717</guid>
      <dc:creator>SailiTang1</dc:creator>
      <dc:date>2020-09-29T01:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add records to related table in ArcGIS Runtime SDK for .NET WPF</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317780#M3718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just put up a post about an issue I had with creating relationship (due to my own fault in the end),&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/thread/260407" target="_blank"&gt;RelateFeature not creating relationship in offline data&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample of how the relationship is created.&amp;nbsp; In this specific example I loop through a set of features to create relationships, but should be pretty straight forward to modify for a single feature.&amp;nbsp; If you were to be changing after the initial creation you could use UpdateFeatureAsync as is mentioned in the post&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; vertexInfo &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; Vertices&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
     &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; vertexFeature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ArcGISFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; vertexTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateFeature&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
     vertexFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; vertexInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapPoint&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

     &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; vertexInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NmeaLocation &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          &lt;SPAN class="token function"&gt;UpdateGpsAttributes&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;vertexFeature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; vertexInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NmeaLocation&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

     &lt;SPAN class="comment token"&gt;// await vertexTable.AddFeatureAsync(vertexFeature); - moved below&lt;/SPAN&gt;

     Log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Debug&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$&lt;SPAN class="string token"&gt;"Relate Feature Origin: {feature.FeatureTable.TableName}:{feature.GetAttributeValue("&lt;/SPAN&gt;OBJECTID&lt;SPAN class="string token"&gt;")}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

     feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;RelateFeature&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;vertexFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      
      &lt;SPAN class="comment token"&gt;// Move to after RelateFeature&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; vertexTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AddFeatureAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;vertexFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

     Log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Debug&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$&lt;SPAN class="string token"&gt;"Relate Feature Destination: {vertexFeature.FeatureTable.TableName}:{vertexFeature.GetAttributeValue("&lt;/SPAN&gt;OBJECTID&lt;SPAN class="string token"&gt;")}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317780#M3718</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T15:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add records to related table in ArcGIS Runtime SDK for .NET WPF</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317781#M3719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply! Your method is perfect and makes sense to me! I am using a stupid way to realize it, but it works. I know that it is not good to do something on global ID field. I am going to use your method! Thank you so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var relatedFeat = relatedTable.CreateFeature();&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;relatedFeat&lt;/SPAN&gt;.SetAttributeValue(&lt;SPAN&gt;relatedFeat&lt;/SPAN&gt;.FeatureTable.GetField("REL_GLOBALID"), parentfeat.GetAttributeValue(&lt;SPAN&gt;parentfeat&lt;/SPAN&gt;.FeatureTable.GetField("GLOBALID")));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;await &lt;SPAN&gt;relatedT&lt;/SPAN&gt;&lt;SPAN&gt;able&lt;/SPAN&gt;.AddFeatureAsync(&lt;SPAN&gt;relatedFeat&lt;/SPAN&gt;);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:09:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-records-to-related-table-in-arcgis-runtime-sdk/m-p/317781#M3719</guid>
      <dc:creator>SailiTang1</dc:creator>
      <dc:date>2020-09-29T15:09:44Z</dc:date>
    </item>
  </channel>
</rss>

