<?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: Branch Version Change To Default option in ArcGIS Pro 3.0 and Arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/branch-version-change-to-default-option-in-arcgis/m-p/1204702#M65370</link>
    <description>&lt;P&gt;try saving the aprx at the end.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Aug 2022 19:31:55 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-08-19T19:31:55Z</dc:date>
    <item>
      <title>Branch Version Change To Default option in ArcGIS Pro 3.0 and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/branch-version-change-to-default-option-in-arcgis/m-p/1204643#M65368</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per our project requirement we want to build a tool using arcpy to change branch version to default.&lt;/P&gt;&lt;P&gt;Detailed Requirement&lt;/P&gt;&lt;P&gt;We are using BRANCH versioned feature service to perform editing's in ArcGIS Pro 3.0.&lt;/P&gt;&lt;P&gt;After completing the edits, requirement is to change the added feature service in TOC from 'child version' to 'SDE.DEFAULT' version using arcpy&lt;/P&gt;&lt;P&gt;&lt;U&gt;Python code we are trying to use:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(r"C:\abc_Pro\Project\abc_Aprx.aprx")&lt;/P&gt;&lt;P&gt;m = aprx.listMaps('Map')[0]&lt;/P&gt;&lt;P&gt;for lyr in m.listLayers():&lt;BR /&gt;if (lyr.name == "APPROVED"):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;arcpy.management.ChangeVersion(lyr, "BRANCH", "sde.DEFAULT", None, "INCLUDE")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(lyr.name)&lt;/P&gt;&lt;P&gt;When we run the above script in "Python Notebook" in ArcGIS Pro, it is working fine.&lt;/P&gt;&lt;P&gt;When we run the same from python script (ex: abc.py), script executing with out errors but services are not changing to "DEFAULT" version.&lt;/P&gt;&lt;P&gt;Anything we are missing in this. Appreciate help on this. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 17:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/branch-version-change-to-default-option-in-arcgis/m-p/1204643#M65368</guid>
      <dc:creator>SU00861536</dc:creator>
      <dc:date>2022-08-19T17:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Branch Version Change To Default option in ArcGIS Pro 3.0 and Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/branch-version-change-to-default-option-in-arcgis/m-p/1204702#M65370</link>
      <description>&lt;P&gt;try saving the aprx at the end.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 19:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/branch-version-change-to-default-option-in-arcgis/m-p/1204702#M65370</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-08-19T19:31:55Z</dc:date>
    </item>
  </channel>
</rss>

