<?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 Re: FeatureLayer:DefinitionExpression not honored on sync in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441812#M5344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing another issue I think related but not the same.&amp;nbsp; Although the workaround is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a background sync service that runs outside the map application.&amp;nbsp; When a change comes to the client through the service the map does not refresh to show that change.&amp;nbsp; I found in this case also that toggling the DefinitionExpression will get the new feature to draw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be really nice is if the API provided some method to force a full redraw of an area as must be getting done by the reset of the definition expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3055"&gt;Jennifer Nery&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Mar 2019 15:51:29 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2019-03-15T15:51:29Z</dc:date>
    <item>
      <title>FeatureLayer:DefinitionExpression not honored on sync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441808#M5340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have noticed that when a FeatureLayer has a DefinitionExpression assigned and a feature gets synced from the server the display does not honor the DefinitionExpression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As example.&amp;nbsp; A FeatureLayer.DefinitionExpression = "STATUS = 'Active'".&amp;nbsp; When the STATUS value is changed at the server to something other than Active the attribute update does sync across as expected and the STATUS field is changed in the offline database.&amp;nbsp; However, the feature is still visible even though it no longer meets the DefinitionExpression.&amp;nbsp; If the application is closed and re-opened the feature is no longer visible as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have tried moving the map, thinking maybe a redraw would refresh the layer but this does not work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to reapply the DefinitionExpression.&amp;nbsp; I was going to try to toggle the expression off then back on but that seems more of a hack then I want to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441808#M5340</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2018-03-22T15:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer:DefinitionExpression not honored on sync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441809#M5341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for reporting this bug. We have logged the issue and I had just verified core fix. Please try again in the next release of ArcGIS Runtime SDK for .NET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also could not find an elegant workaround for this. I don't know if it's an option for you to temporarily remove the layer from the map until SyncGeodatabaseJob completes.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;MyMapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&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; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; job&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetResultAsync&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;
MyMapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should you decide to reset `FeatureLayer.DefinitionExpression`, you might also want to set the visibility of the features that do not satisfy definition expression.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Reset `DefinitionExpression`&lt;/SPAN&gt;
layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1=1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureTable &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ArcGISFeatureTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Change visibility of features that do not satisfy `DefinitionExpression`&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; table&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;QueryFeaturesAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryParameters&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; WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"type &amp;lt;&amp;gt; 2"&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;
layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetFeaturesVisible&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;features&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&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; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; job&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetResultAsync&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="comment token"&gt;// Set `DefinitionExpression` back &lt;/SPAN&gt;
layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"type = 2"&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441809#M5341</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T19:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer:DefinitionExpression not honored on sync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441810#M5342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to just toggle the DefinitionExpression off/on and have it work to refresh the view.&amp;nbsp; If you are really paying attention you do see a bit of a flash, but so far the users have not complained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I loop through all the layers in the Geodatabase at the end of a sync and reset the DefinitionExpression like below&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;string&lt;/SPAN&gt; expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; expression&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:46:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441810#M5342</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T19:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer:DefinitionExpression not honored on sync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441811#M5343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool thanks for sharing your workaround. That doesn't sound so bad then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 23:31:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441811#M5343</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2018-05-07T23:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer:DefinitionExpression not honored on sync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441812#M5344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing another issue I think related but not the same.&amp;nbsp; Although the workaround is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a background sync service that runs outside the map application.&amp;nbsp; When a change comes to the client through the service the map does not refresh to show that change.&amp;nbsp; I found in this case also that toggling the DefinitionExpression will get the new feature to draw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be really nice is if the API provided some method to force a full redraw of an area as must be getting done by the reset of the definition expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3055"&gt;Jennifer Nery&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2019 15:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/featurelayer-definitionexpression-not-honored-on/m-p/441812#M5344</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-15T15:51:29Z</dc:date>
    </item>
  </channel>
</rss>

