I've got a feature class that I am trying to remove the Global ID and editor information fields from. So far, the best way I can figure out is to create a new version of the feature class without the fields and append the data across. I've tried the following code I found online and tweaked, but am stuck on the field mapping.
The input FC is "Prod_Temp" and I want the output to be "Prod_Sync". The fields listed in myfields are the fields in "Prod_Temp" that I want to retain. When I run the script, it complains about something around Line 10. I think I'm misunderstanding the input option for map.addInputField(existingFC, field).
Any pointers?
existingFC = (r"W:\TEMP\Prod_Temp.gdb\Prod_Temp")
myfields = ['FPCBusinessArea', 'Location', 'OpType', 'OperationStatus', 'Contractor', 'ContractorSupervisor', 'SupervisorPhone', 'FPCOIC', 'FPCOICPhone', 'Machinery', 'Comments', ]
mapS = arcpy.FieldMappings()
for field in myfields :
map = arcpy.FieldMap()
map.addInputField(existingFC, field)
mapS.addFieldMap(map)
Prod_Sync = arcpy.FeatureClassToFeatureClass_conversion(existingFC, r"W:\TEMP\Prod_Sync.gdb", "Prod_Sync", "", mapS)
Lindsay Raabe
GIS Officer
Forest Products Commission WA