I'm encountering a strange roadblock and was looking to see if anyone else has experienced this.
I am trying to write a python script that will turn some of my fields to "read only" within my ArcPro project. My current script that that I have written will turn all fields to "read only" for the sake of testing. I have added a message to double check the properties of the field to confirm that it has been set to "read only." However in my current project, my fields still show as unchecked for the "read only" property.
Has anyone else been able to configure a script that would allow fields to retain this setting in their project? I was thinking maybe it had something to do with saving my project? Below is a copy of my script. Any help would be greatly appreciated!
# Set variables
project = arcpy.mp.ArcGISProject('CURRENT')
map = project.listMaps('Map')
layer = arcpy.GetParameterAsText(0)
desc = arcpy.Describe(layer)
for field in desc.fields:
field.editable = False
Updating a field property only updates the field object, no changes are made to the actual field in the table or feature class.
You would have more luck using
where you can alter field properties as well as field names