How can I alter the aliases of the required fields (ObjectID, Shape, Shape_Length, Shape_Area) in a GDB with Python?
For example I have this code:
rf = ur'D:\Δοκιμές\Tester'
gdb = rf+'\\Ant.gdb'
p = ['Parcels','Parts']
for a in range(2):
RFields = OrderedDict([(arcpy.Describe(gdb+'\\'+p[a]).OIDFieldName,u'Α/Α'),(u'Shape',u'Γεωμετρία'),(arcpy.Describe(gdb+'\\'+p[a]).lengthFieldName,u'Περίμετρος'),(arcpy.Describe(gdb+'\\'+p[a]).AreaFieldName,u'Εμβαδόν')])
for key in RFields.keys():
arcpy.AlterField_management(gdb+'\\'+p[a],key,key,RFields[key])
But it produces an error:
Failed to execute (AlterField).
Is it possible to do what I want?
The full error:
Runtime error Traceback (most recent call last):
File "<string>", line 8, in <module>
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 3239, in AlterField
raise e ExecuteError:
ERROR 001600: Failed to alter field name.
ERROR 001660: Cannot alter field name on required fields.
Failed to execute (AlterField).