I'm having an issue with the "Aleter Field" gp tool in python. I find that it works fine when running the tool from Desktop or in a model, but as soon as I run it from python, it doesn't work and resets all my alias field back to the field names. This only occurs for spatial views I setup, works fine on feature classes.
Steps to reproduce
- Setup a spatial view.
- Setup a few field aliases in ArcGIS Desktop for the spatial view.
- Run the "Alter Field" gp tool from python on one field e.g. arcpy.AlterField_management(spatialView, "PERMIT_NUMBER", "", "Permit Number")
- Navigate to the spatial view in ArcGIS Desktop and notice that all the field aliases have been reset to the field names.
A bit late, but I don't believe AlterField_management
supports views - the input parameter is a Table View. The input parameter for MakeTableView_management
(which would go into AlterField_management) is a table or feature class - view is not specified.
Did you contact Support with this issue? I'd be curious to hear if they had a workaround - it seems reasonable that since the alias of a field in a registered spatial view can be altered in ArcCatalog GUI, then it ought to be possible with GP (if not then it should be!).