Hi Everyone,
When we enable editor tracking, ESRI creates the created_user,created_date, last_editor,last_edited_date, However, we want to point it to a different field defined in our data model like creator, creation_date, lastuser, lastmodified. PResently there is a manual process to manually going to the properties> Enable Editor Tracking> map the fields. We have a lot of data to run this manual process. Is there any python screen, tool or any other way to enable editor tracking with fields other than the Esri defined fields.
Thank you.
Regards,
Ranjit
GIS Solution Architect
If the feature classes in your geodatabase have the same field names that can be used for the tools input, you can run something like what's listed below. You can list the feature classes in the database, iterate over them and enable ET on each feature class.
There is also a script on the arcgis website that would work. Enable Editor Tracking—Help | ArcGIS for Desktop
import arcpy
database = r'path/to/database'
#set workspace
arcpy.env.workspace = database
#list of fields
creator = 'creator'
create_date = 'create_date'
last_editor = 'last_editor'
last_edit_date = 'last_edit_date'
#list featureclasses in database
featureClasses = arcpy.ListFeatureClasses()
#iterate over featureclasses and enable
#editor tracking based on fields above
for fc in featureClasses:
arcpy.EnableEditorTracking_management(creator,
create_date,
last_editor,
last_edit_date)
print ("Editor tracking enabled for: {}".format(fc))
Can we map the fields to
creator, creation_date, lastuser, lastmodified
rather than Esri defined fields?
i am using a script to enable editor tracking of all feature classes of many datasets. it works for a bit but then i get "ERROR 001278: Field does not exist....." The fields DO exist, just as they do in the feature classes in which the script works. I don't know why it gets hung up.
Use the "Enable Editor Tracking" tool (Script it out if required):
ArcGIS Pro: Enable Editor Tracking—Data Management toolbox | ArcGIS Desktop
ArcGIS Desktop: Enable Editor Tracking—Help | ArcGIS Desktop
Be aware that there are some scenarios where the tool/python gp task fails
See posting from @HarlenMarshallEnable Editor Tracking tool does NOT work
Yes, its pretty inconsistent