Enable Editor Tracking (Data Management)

License Level:BasicStandardAdvanced

Summary

Enables editor tracking for a feature class, table, mosaic dataset, or raster catalog.

Learn more about editor tracking

Usage

Syntax

EnableEditorTracking_management (in_dataset, {creator_field}, {creation_date_field}, {last_editor_field}, {last_edit_date_field}, {add_fields}, {record_dates_in})
ParameterExplanationData Type
in_dataset

The feature class, table, mosaic dataset, or raster catalog that will have editor tracking enabled.

Dataset
creator_field
(Optional)

The name of the field that will store the names of users who created features or records. If this field already exists, it must be a String field.

String
creation_date_field
(Optional)

The name of the field that will store the dates features or records were created. If this field already exists, it must be a Date field.

String
last_editor_field
(Optional)

The name of the field that will store the names of users who last edited features or records. If this field already exists, it must be a String field.

String
last_edit_date_field
(Optional)

The name of the field that will store the dates features or records were last edited. If this field already exists, it must be a Date field.

String
add_fields
(Optional)

Specifies whether to add fields if they don't already exist.

  • NO_ADD_FIELDSFields will not be added. Fields specified must already exist. This is the default.
  • ADD_FIELDSFields will be added if they don't already exist.
Boolean
record_dates_in
(Optional)

The time created date and last edited date will be recorded in. The default is UTC (Coordinated Universal Time).

  • UTCRecord dates in UTC (Coordinated Universal Time). This is the default.
  • DATABASE_TIMERecord dates in the time zone in which the database is located.
String

Code Sample

EnableEditorTracking example (Python window)

The following Python window script demonstrates how to use the EnableEditorTracking tool in immediate mode.

import arcpy
arcpy.EnableEditorTracking_management("d:/RC.gdb/Buildings","Creator","Created","Editor","Edited","ADD_FIELDS","UTC")
EnableEditorTracking example 2 (stand-alone script)

The following stand-alone script demonstrates how to enable editor tracking on all the feature classes and tables in a geodatabase.

# Name: EnableEditorTracking_Ex02.py
# Description: Enables editor tracking for all datasets in a geodatabase

# Import system modules
import arcpy, os

# Set the workspace
workspace = arcpy.GetParameterAsText(0)

# Set the workspace environment
arcpy.env.workspace = "d:/test/data.gdb"

# Get all the stand alone tables and feature classes
dataList = arcpy.ListTables() + arcpy.ListFeatureClasses()

# For feature datasets get all of the featureclasses
# from the list and add them to the master list
for dataset in arcpy.ListDatasets("", "Feature"):
    arcpy.env.workspace = os.path.join(workspace,dataset)
    dataList += arcpy.ListFeatureClasses()

# Execute enable editor tracking
for dataset in dataList:
    print 'Enabling tracking on ' + dataset
    arcpy.EnableEditorTracking_management(dataset, "ET_CREATOR",
    "ET_CREATED", "ET_EDITOR", "ET_EDITED", "ADD_FIELDS", "UTC")
print 'Enabling complete'

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
5/7/2015