<?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>idea Refresh field Descriptions  from Datasource function in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/refresh-field-descriptions-from-datasource/idi-p/1200276</link>
    <description>&lt;P&gt;The idea is to have a function in Pro / Python to refresh the field descriptions for a layer.&lt;/P&gt;&lt;P&gt;Function on a layer: Refresh fields from datasource, this loads all fields from the datasource and replaces the current custom fields description.&lt;/P&gt;&lt;P&gt;The use-case: I need to change the datasource of a layer and I want to refresh the fields information (Names, Aliasses and order etc.). At this moment this option is not available and I have to create a new layer and copy the style, scales, displayname and layrid from the old layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have to do this, which is slow on ApplySymbologyFromLayer. I would&amp;nbsp;like to have fast option like: layer.refreshFields()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer = arcpy.management.MakeFeatureLayer(viewpath, layername)[0]
arcpy.management.ApplySymbologyFromLayer(layer, oldlyr, None, "MAINTAIN")
layerdef = layer.getDefinition('V2')
layerdef.minScale = minScale
layerdef.maxScale = maxScale
layerdef.serviceLayerID = layerid
oldlayerdef = oldlyr.getDefinition('V2')
layerdef.featureTable.displayField = oldlayerdef.featureTable.displayField
print(f'Displayfield: {layerdef.featureTable.displayField}')
layer.setDefinition(layerdef)
m.moveLayer(oldlyr, layer, 'AFTER')
m.removeLayer(oldlyr)
print('Layer Done')&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>Mon, 08 Aug 2022 12:33:18 GMT</pubDate>
    <dc:creator>WoutervanderHulst</dc:creator>
    <dc:date>2022-08-08T12:33:18Z</dc:date>
    <item>
      <title>Refresh field Descriptions  from Datasource function</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/refresh-field-descriptions-from-datasource/idi-p/1200276</link>
      <description>&lt;P&gt;The idea is to have a function in Pro / Python to refresh the field descriptions for a layer.&lt;/P&gt;&lt;P&gt;Function on a layer: Refresh fields from datasource, this loads all fields from the datasource and replaces the current custom fields description.&lt;/P&gt;&lt;P&gt;The use-case: I need to change the datasource of a layer and I want to refresh the fields information (Names, Aliasses and order etc.). At this moment this option is not available and I have to create a new layer and copy the style, scales, displayname and layrid from the old layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have to do this, which is slow on ApplySymbologyFromLayer. I would&amp;nbsp;like to have fast option like: layer.refreshFields()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer = arcpy.management.MakeFeatureLayer(viewpath, layername)[0]
arcpy.management.ApplySymbologyFromLayer(layer, oldlyr, None, "MAINTAIN")
layerdef = layer.getDefinition('V2')
layerdef.minScale = minScale
layerdef.maxScale = maxScale
layerdef.serviceLayerID = layerid
oldlayerdef = oldlyr.getDefinition('V2')
layerdef.featureTable.displayField = oldlayerdef.featureTable.displayField
print(f'Displayfield: {layerdef.featureTable.displayField}')
layer.setDefinition(layerdef)
m.moveLayer(oldlyr, layer, 'AFTER')
m.removeLayer(oldlyr)
print('Layer Done')&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>Mon, 08 Aug 2022 12:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/refresh-field-descriptions-from-datasource/idi-p/1200276</guid>
      <dc:creator>WoutervanderHulst</dc:creator>
      <dc:date>2022-08-08T12:33:18Z</dc:date>
    </item>
  </channel>
</rss>

