<?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: ChangeVersion in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794366#M1716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you change the code to iterate through the versions on the&amp;nbsp;geodatabase connection and verify that you are seeing all of the expected versions? &amp;nbsp;I'm trying to figure out if the problem is with versioning or with actually switching the map layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Sep 2019 14:59:06 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2019-09-17T14:59:06Z</dc:date>
    <item>
      <title>ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794363#M1713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to use the Change Version (&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11861.html" title="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11861.html"&gt;ArcGIS Pro 2.4 API Reference Guide&lt;/A&gt;) method on my current map and do not get the results I would expect.&amp;nbsp; I copied the code example directly into a button action. The UI doesn't show that the version has changed and there are no errors reported.&amp;nbsp; My Map has layers using the classic versioning model.&amp;nbsp; Is there something else that needs to be done to the UI to refresh?&amp;nbsp; Is there another way to get all the layers in a map to point to a different version?&lt;/P&gt;&lt;P&gt;#arcgisprosdk‌&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 16:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794363#M1713</guid>
      <dc:creator>JimmyBowden</dc:creator>
      <dc:date>2019-09-12T16:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794364#M1714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jimmy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the risk of asking a stupid question, is the first layer in your map a feature layer that points to a versioned feature class? &amp;nbsp;That sample code only works if that is the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 16:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794364#M1714</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-09-13T16:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794365#M1715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure got to start with the easy questions.&amp;nbsp; All the layers in my map (except basemap) are versioned pointing to an Oracle 12.1 enterprise geodatabase.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 18:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794365#M1715</guid>
      <dc:creator>JimmyBowden</dc:creator>
      <dc:date>2019-09-16T18:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794366#M1716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you change the code to iterate through the versions on the&amp;nbsp;geodatabase connection and verify that you are seeing all of the expected versions? &amp;nbsp;I'm trying to figure out if the problem is with versioning or with actually switching the map layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 14:59:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794366#M1716</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-09-17T14:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794367#M1717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the updated code I ran (changes in red).&amp;nbsp; The first time it ran I noticed that the first version was owned by another user but set to public.&amp;nbsp; I thought that might be an issue so I added the IsOwner and still got the same lack of result.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;await QueuedTask.Run(() =&amp;gt;
 {
 FeatureLayer flyr = MapView.Active.Map.GetLayersAsFlattenedList()
 .OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(); //first feature layer
 Datastore dataStore = flyr.GetFeatureClass().GetDatastore(); //getting datasource
 Geodatabase geodatabase = dataStore as Geodatabase; //casting to Geodatabase
 if (geodatabase == null)
 return;

VersionManager versionManager = geodatabase.GetVersionManager();
 ArcGIS.Core.Data.Version currentVersion = versionManager.GetCurrentVersion();
//Getting all available versions except the current one
 IEnumerable&amp;lt;ArcGIS.Core.Data.Version&amp;gt; versions = versionManager.GetVersions()
 .Where(v =&amp;gt; !v.GetName().Equals(currentVersion.GetName(), StringComparison.CurrentCultureIgnoreCase) &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;amp;&amp;amp; v.IsOwner()&lt;/STRONG&gt;&lt;/SPAN&gt;);
&lt;SPAN style="color: #ff0000;"&gt; &lt;STRONG&gt;foreach (var item in versions)&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt; {&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt; System.Diagnostics.Debug.WriteLine(item.GetName());&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt; }&lt;/STRONG&gt;&lt;/SPAN&gt;
 //Assuming there is at least one other version we pick the first one from the list
 ArcGIS.Core.Data.Version toVersion = versions.FirstOrDefault();
 if (toVersion != null)
 {
 //Changing version
 MapView.Active.Map.ChangeVersion(currentVersion, toVersion);
 } &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794367#M1717</guid>
      <dc:creator>JimmyBowden</dc:creator>
      <dc:date>2021-12-12T16:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794368#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you haven't done so already, I would take a look at toVersion.GetName() prior to calling Map.ChangeVersion() to verify that the value is expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outside of that, I don't have any other ideas. &amp;nbsp;I set up an Oracle 12 environment that used classic versioning, and ran the sample code to switch&amp;nbsp;the version from SDE.DEFAULT to the next version in the list (GDB.foo). &amp;nbsp;It all works correctly, and the Map refreshes afterwards. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to open an incident with tech support to figure out why this isn't working for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/459903_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2019 19:22:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794368#M1718</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-09-18T19:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794369#M1719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for being checking.&amp;nbsp; I tried a different Oracle instance and it works great so it's just something with that specific instance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2019 21:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794369#M1719</guid>
      <dc:creator>JimmyBowden</dc:creator>
      <dc:date>2019-09-18T21:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794370#M1720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue in the Oracle instance where this failed to work was that there was a version set to public but it's parent was set to private.&amp;nbsp; When the version manager is opened in ArcGIS Pro this version was marked red and version tools would not behave until this issue was cleared up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2019 21:42:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794370#M1720</guid>
      <dc:creator>JimmyBowden</dc:creator>
      <dc:date>2019-11-18T21:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: ChangeVersion</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794371#M1721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A-ha! &amp;nbsp;Thanks for following up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2019 22:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changeversion/m-p/794371#M1721</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-11-18T22:00:56Z</dc:date>
    </item>
  </channel>
</rss>

