<?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 Force update on Feature-Linked Annotation. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1192371#M8424</link>
    <description>&lt;P&gt;I'm developing a tool in ArcGIS Pro related to annotation. In the tool, I'm creating feature-linked annotation for existing features and relating them together after the annotation is created. Currently, the Arcade label expression for the annotation doesn't automatically update the text string for the annotation after the relationship is created and I'm unsure of how to do this programmatically.&lt;/P&gt;&lt;P&gt;Is there a way to do this?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 22:45:08 GMT</pubDate>
    <dc:creator>RichardOxales</dc:creator>
    <dc:date>2022-07-14T22:45:08Z</dc:date>
    <item>
      <title>Force update on Feature-Linked Annotation.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1192371#M8424</link>
      <description>&lt;P&gt;I'm developing a tool in ArcGIS Pro related to annotation. In the tool, I'm creating feature-linked annotation for existing features and relating them together after the annotation is created. Currently, the Arcade label expression for the annotation doesn't automatically update the text string for the annotation after the relationship is created and I'm unsure of how to do this programmatically.&lt;/P&gt;&lt;P&gt;Is there a way to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 22:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1192371#M8424</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2022-07-14T22:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Force update on Feature-Linked Annotation.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1193728#M8446</link>
      <description>&lt;P&gt;Feature-linked annotation text only updates if the base feature is updated of the annotation is edited directly. There are two approaches I could see for your case.&lt;/P&gt;&lt;P&gt;1) Update a field used in the expression and the event will fire an the annotation will update.&lt;/P&gt;&lt;P&gt;2) Or use calculate field on the TextString field of the annotation feature class with the label expression as the Arcade expression for the too.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 23:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1193728#M8446</guid>
      <dc:creator>CraigWilliams</dc:creator>
      <dc:date>2022-07-19T23:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Force update on Feature-Linked Annotation.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1193986#M8456</link>
      <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;I ended up using the first approach as I wanted to get something done quick, but I'll likely convert it into the second option instead to be more agnostic about which fields I need to update.&lt;/P&gt;&lt;P&gt;Here is what I had written at first for the first approach, for anyone else who may need code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;QueuedTask.Run(() =&amp;gt;
{
	var editOperation = new EditOperation();
	var fieldName = "name";
	editOperation.Callback(context =&amp;gt;
	{
		relate.CreateRelationship(_sourceFeature, annoFeature);
		ForceFeatureLinkedAnnoUpdate(_sourceFeature, _sourceAnnoFeatureLayer as AnnotationLayer, fieldName);
		context.Invalidate(_sourceFeature);
	}, _sourceFeatureLayer, _sourceAnnoFeatureLayer);

	bool editResult = editOperation.Execute();
	MapView.Active.Redraw(true);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void ForceFeatureLinkedAnnoUpdate(Feature sourceFeature, AnnotationLayer annoLayer, string fieldName)
{
    var fields = sourceFeature.GetFields().ToList();

    if (sourceFeature.FindField(fieldName) &amp;gt; -1)
    {
        var currentValue = sourceFeature[fieldName];
        sourceFeature[fieldName] = "LOADING ANNOTATION";
        sourceFeature.Store();
        sourceFeature[fieldName] = currentValue;
        sourceFeature.Store();
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 15:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1193986#M8456</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2022-07-20T15:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Force update on Feature-Linked Annotation.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1197640#M8534</link>
      <description>&lt;P&gt;Hi again. I'm getting back to this and trying the second option to set the TextString field of the annotation feature class via a Calculate Field operation, but I'm not having much luck implementing this.&lt;/P&gt;&lt;P&gt;If I copy the label expression in the anno feature class directly onto the anno feature's TextString field (eg. "$feature.NAME"), Calculate Field fails because it's unable to find a 'NAME' field in the anno feature class, since the 'NAME' field is on the feature class that the annotation feature class is linked to.&lt;/P&gt;&lt;P&gt;Is there a way around this? Currently, I'm trying to explore options on the linked feature class itself (eg. QueryDisplayExpressions)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 22:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/force-update-on-feature-linked-annotation/m-p/1197640#M8534</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2022-07-29T22:06:49Z</dc:date>
    </item>
  </channel>
</rss>

