I'm currently using a ArcGIS Pro and built in Jupyter Notebook to make changes to my feature layers (and some feature tables). Basically I'm hiding all the empty fields using field_info.setVisible().
Then I make new feature layer by overwriting it with this code. arcpy.management.MakeFeatureLayer(data_source, data_source.name, field_info=field_info)
Just for reference, field_info = arcpy.Describe(data_source).fieldInfo
When I run through all the layers with code, it resets the Layer ID from 0 and on.
I use these layers for AGOL (Web map) updates and the assigned Layer ID property is very important.
I can't seem to find any document regarding either maintaining the Layer ID or assigning Layer ID by code. All I found was the manual way of right clicking the layer > properties > set Layer ID.
This is extremely inconvenient as I have 20+ layers in each map and over 30 maps to work on.
Any help would be greatly appreciated.
Thanks!