<?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 Problem using scripts to calculate fields in ArcPro Fabric Branched Versioning 3.0+ in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/problem-using-scripts-to-calculate-fields-in/m-p/1231212#M62180</link>
    <description>&lt;P&gt;We use a lot of tools/scripts to calculate values within the ArcPro/Parcel Fabric Branched Version Environment (when it makes sense not to use tasks or calc attribute rules).&amp;nbsp; &amp;nbsp;I am testing Version 3.0+ and have run into the following problem and am hoping that I may doing something wrong.&amp;nbsp; After a lot of testing I have created the following simple script that that illustrates the problem. (This all works fine in 2.94 and in a standard GeoDatabase). We do not use SDE for editing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start State: Within Branched Version (GISADMIN.T67_9c_Test200Anno4)&amp;nbsp; map session, Anno0200Scale feature class with Field (MapNumber) with value set to '6.3.8C').&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Process: APRX is open, Tool in Tool Box runs script,&amp;nbsp; Select&amp;nbsp;OBJECTID = 7695 and Calc the value for MapNumber to be "XXXX" .&amp;nbsp; I have tested this using arcpy.da.Editor using UpdateCursor with the Source being:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://giscarts.co.polk.or.us/server/rest/services/PF/Parcel_Fabric_3/FeatureServer;VERSION=GISADMIN.T67_9c_Test200Anno4;VERSIONGUID=%7B6284F53F-3A4B-4FFF-994E-7606A6AA3783%7D" target="_blank" rel="nofollow noopener noreferrer"&gt;https://giscarts.co.polk.or.us/server/rest/services/PF/Parcel_Fabric_3/FeatureServer;VERSION=GISADMI...&lt;/A&gt;&amp;nbsp; which I calculate from the datasource of the Anno0200Scale feature class (after I removed the feature class name from the datasource text string).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tested this without using the arcpy.da.Editor with da.UpdateCursor.&amp;nbsp; I have also tested this with a simple CalculateField both using the arcpy.da.editor and not using it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem:&amp;nbsp; I always get the same result.&amp;nbsp; NOTHING HAPPENS unless I close the ArcPro session and reopen it. Then I can see the change.&amp;nbsp; Using refresh screen / Change Version tool etc... None of it works.&amp;nbsp; Its like the edit did not happen until I close the session and then go back in.&amp;nbsp; My hope is that I am doing something wrong and somebody can help me out.&amp;nbsp; Below is the script (again this is not production just a test).&amp;nbsp; - it is also attached as a txt file.&amp;nbsp; Finally, within a simple edit session I can interactively select features and calculate attributes, see the results with no problem.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;/P&gt;&lt;P&gt;# 1. Get parameter values&lt;/P&gt;&lt;P&gt;AnnoLayer = 'Anno0200Scale'&lt;/P&gt;&lt;P&gt;#2. Set Map Layers and default paths&lt;/P&gt;&lt;P&gt;thisProject = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;Map = thisProject.activeMap&lt;BR /&gt;AnnoLyr = Map.listLayers(AnnoLayer)[0]&lt;BR /&gt;FolderPath = thisProject.homeFolder&lt;/P&gt;&lt;P&gt;arcpy.AddMessage ("Map: " + Map.name)&lt;BR /&gt;arcpy.AddMessage (AnnoLyr.dataSource)&lt;/P&gt;&lt;P&gt;datasource = AnnoLyr.dataSource&lt;BR /&gt;lastslash = datasource.rfind("/")&lt;BR /&gt;workspace = datasource[:lastslash]&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(workspace)&lt;/P&gt;&lt;P&gt;MapNumber = 'XXXX'&lt;/P&gt;&lt;P&gt;# do edit session (Comment it out if you do not want to use it&lt;/P&gt;&lt;P&gt;edit = arcpy.da.Editor(workspace)&lt;BR /&gt;edit.startEditing(with_undo=False, multiuser_mode=True)&lt;BR /&gt;edit.startOperation()&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(AnnoLyr, ["MapNumber"],"OBJECTID = 7695") as cursor:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;row[0] = MapNumber&lt;BR /&gt;cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;edit.stopOperation()&lt;BR /&gt;edit.stopEditing(save_changes=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 13:13:19 GMT</pubDate>
    <dc:creator>DeanAnderson2</dc:creator>
    <dc:date>2022-11-14T13:13:19Z</dc:date>
    <item>
      <title>Problem using scripts to calculate fields in ArcPro Fabric Branched Versioning 3.0+</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/problem-using-scripts-to-calculate-fields-in/m-p/1231212#M62180</link>
      <description>&lt;P&gt;We use a lot of tools/scripts to calculate values within the ArcPro/Parcel Fabric Branched Version Environment (when it makes sense not to use tasks or calc attribute rules).&amp;nbsp; &amp;nbsp;I am testing Version 3.0+ and have run into the following problem and am hoping that I may doing something wrong.&amp;nbsp; After a lot of testing I have created the following simple script that that illustrates the problem. (This all works fine in 2.94 and in a standard GeoDatabase). We do not use SDE for editing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start State: Within Branched Version (GISADMIN.T67_9c_Test200Anno4)&amp;nbsp; map session, Anno0200Scale feature class with Field (MapNumber) with value set to '6.3.8C').&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Process: APRX is open, Tool in Tool Box runs script,&amp;nbsp; Select&amp;nbsp;OBJECTID = 7695 and Calc the value for MapNumber to be "XXXX" .&amp;nbsp; I have tested this using arcpy.da.Editor using UpdateCursor with the Source being:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://giscarts.co.polk.or.us/server/rest/services/PF/Parcel_Fabric_3/FeatureServer;VERSION=GISADMIN.T67_9c_Test200Anno4;VERSIONGUID=%7B6284F53F-3A4B-4FFF-994E-7606A6AA3783%7D" target="_blank" rel="nofollow noopener noreferrer"&gt;https://giscarts.co.polk.or.us/server/rest/services/PF/Parcel_Fabric_3/FeatureServer;VERSION=GISADMI...&lt;/A&gt;&amp;nbsp; which I calculate from the datasource of the Anno0200Scale feature class (after I removed the feature class name from the datasource text string).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tested this without using the arcpy.da.Editor with da.UpdateCursor.&amp;nbsp; I have also tested this with a simple CalculateField both using the arcpy.da.editor and not using it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem:&amp;nbsp; I always get the same result.&amp;nbsp; NOTHING HAPPENS unless I close the ArcPro session and reopen it. Then I can see the change.&amp;nbsp; Using refresh screen / Change Version tool etc... None of it works.&amp;nbsp; Its like the edit did not happen until I close the session and then go back in.&amp;nbsp; My hope is that I am doing something wrong and somebody can help me out.&amp;nbsp; Below is the script (again this is not production just a test).&amp;nbsp; - it is also attached as a txt file.&amp;nbsp; Finally, within a simple edit session I can interactively select features and calculate attributes, see the results with no problem.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;/P&gt;&lt;P&gt;# 1. Get parameter values&lt;/P&gt;&lt;P&gt;AnnoLayer = 'Anno0200Scale'&lt;/P&gt;&lt;P&gt;#2. Set Map Layers and default paths&lt;/P&gt;&lt;P&gt;thisProject = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;Map = thisProject.activeMap&lt;BR /&gt;AnnoLyr = Map.listLayers(AnnoLayer)[0]&lt;BR /&gt;FolderPath = thisProject.homeFolder&lt;/P&gt;&lt;P&gt;arcpy.AddMessage ("Map: " + Map.name)&lt;BR /&gt;arcpy.AddMessage (AnnoLyr.dataSource)&lt;/P&gt;&lt;P&gt;datasource = AnnoLyr.dataSource&lt;BR /&gt;lastslash = datasource.rfind("/")&lt;BR /&gt;workspace = datasource[:lastslash]&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(workspace)&lt;/P&gt;&lt;P&gt;MapNumber = 'XXXX'&lt;/P&gt;&lt;P&gt;# do edit session (Comment it out if you do not want to use it&lt;/P&gt;&lt;P&gt;edit = arcpy.da.Editor(workspace)&lt;BR /&gt;edit.startEditing(with_undo=False, multiuser_mode=True)&lt;BR /&gt;edit.startOperation()&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(AnnoLyr, ["MapNumber"],"OBJECTID = 7695") as cursor:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;row[0] = MapNumber&lt;BR /&gt;cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;edit.stopOperation()&lt;BR /&gt;edit.stopEditing(save_changes=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 13:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/problem-using-scripts-to-calculate-fields-in/m-p/1231212#M62180</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2022-11-14T13:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using scripts to calculate fields in ArcPro Fabric Branched Versioning 3.0+</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/problem-using-scripts-to-calculate-fields-in/m-p/1231317#M62195</link>
      <description>&lt;P&gt;This problem may be larger then first reported.&amp;nbsp; I ran the following interactively.&amp;nbsp; I have a feature class (displayed as a layer) in a local geodatabase (Taxlot_linesAnno0200) and a branched version service layer called Anno0200Scale.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DeanAnderson2_0-1668445425715.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55901iA756635FCD4B69ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DeanAnderson2_0-1668445425715.png" alt="DeanAnderson2_0-1668445425715.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attempted to append the features (4) in Taxlot_linesAnno2400 to a branched version Layer (Anno0200Scale).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DeanAnderson2_1-1668445517363.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55902iD78A606185B79DC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DeanAnderson2_1-1668445517363.png" alt="DeanAnderson2_1-1668445517363.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When finished the 4 features do NOT appear in my Anno020)Scale feature class.&amp;nbsp; However the DO appear in the attribute table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DeanAnderson2_2-1668445640675.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55903iF20EDDF316304581/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DeanAnderson2_2-1668445640675.png" alt="DeanAnderson2_2-1668445640675.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I double click on the row in the table THEN it will appear on the map.&amp;nbsp; In addition if I leave the project and re-open the project then all features will appear normally.&amp;nbsp; &amp;nbsp;I am hoping we have something setup incorrectly in how I am referencing this version or if it is a bug it gets fixed soon.&amp;nbsp; I will be reporting this as a bug today.&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 17:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/problem-using-scripts-to-calculate-fields-in/m-p/1231317#M62195</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2022-11-14T17:11:08Z</dc:date>
    </item>
  </channel>
</rss>

