Enable Editor Tracking (Data Management)

Summary

Enables editor tracking for a feature class, table, feature dataset, or relationship class in a geodatabase.

Usage

    Caution:

    This tool modifies the input data. See Tools that modify or update the input data for more information and strategies to avoid undesired data changes.

  • If the input dataset is from an enterprise geodatabase, it must be from a database connection established as the data owner.

  • This tool can add fields if they do not exist. If fields do exist, they must be of the correct data type. The values specified for the Creator Field and Last Editor Field parameters must be string fields, and the values specified for the Creation Date Field and Last Edit Date Field parameters must be date fields.

  • Editor tracking applies to operations on existing datasets only. It does not apply to operations that create datasets. For example, if you copy a dataset to create a new one, tracking values will not update in the new dataset.

  • You can record the dates of edits in either the time zone in which the database is located or in coordinated universal time (UTC).

    If you plan to copy or replicate data across time zones or edit through a feature service, use UTC. Since editors can apply edits from potentially anywhere in the world, UTC works well because it ensures that times are recorded in a universally accepted and consistent way.

    Configuring editor tracking to use the time zone in which the database is located is only recommended if you are certain that all edits will be performed in that time zone.

  • You can run this tool on a dataset that has editor tracking enabled but only to enable tracking of additional information. For example, if a dataset is only tracking the creator and creation date, you can run this tool to add tracking of the editor and last edited date. This tool cannot disable tracking on a field, switch tracking from one field to another, or switch between UTC and the database time zone. If you need to perform any of these operations, disable editor tracking on the input dataset before you run this tool.

  • Not all relationship class types can have editor tracking enabled. Editor tracking can only be enabled on table-based relationship classes (that is, many-to-many or attributed relationship classes).

  • If editor tracking is enabled on a feature class that has attachments, editor tracking will also be enabled on the attachment table. If you add new fields, those fields will also be added to the attachment table. If you reuse existing fields, and those fields do not exist in the attachment table, they will be added.

  • At ArcGIS Pro 2.4, feature datasets are supported as input for this tool. If you add new fields to each item in the feature dataset, the fields will be named created_user, created_date, last_edited_user, and last_edited_date by default. If you use existing fields, the fields must already exist for all items in the feature dataset.

Parameters

LabelExplanationData Type
Input Dataset

The feature class, table, feature dataset, or relationship class in which editor tracking will be enabled.

Dataset; Topology; Network Dataset
Creator Field
(Optional)

The name of the field that will store the names of users who create 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 date that features or records are 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 date that features or records were last edited. If this field already exists, it must be a date field.

String
Add fields
(Optional)

Specifies whether fields will be added if they don't exist.

  • Unchecked—Fields will not be added. Fields specified must already exist in the Input Dataset parameter value. This is the default.
  • Checked—Fields will be added if they do not exist. You must specify the names of the fields to add in the Creator Field, Creation Date Field, Last Editor Field, and Last Edit Date Field parameters.
Boolean
Record Dates in
(Optional)

Specifies the time format in which the created date and last edited date will be recorded.

  • UTC (Coordinated Universal Time)Dates will be recorded in UTC. This is the default.
  • Time zone of databaseDates will be recorded in the time zone in which the database is located.
String

Derived Output

LabelExplanationData Type
Modified Input Dataset

The modified input dataset.

Dataset

arcpy.management.EnableEditorTracking(in_dataset, {creator_field}, {creation_date_field}, {last_editor_field}, {last_edit_date_field}, {add_fields}, {record_dates_in})
NameExplanationData Type
in_dataset

The feature class, table, feature dataset, or relationship class in which editor tracking will be enabled.

Dataset; Topology; Network Dataset
creator_field
(Optional)

The name of the field that will store the names of users who create 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 date that features or records are 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 date that features or records were last edited. If this field already exists, it must be a date field.

String
add_fields
(Optional)

Specifies whether fields will be added if they don't exist.

  • NO_ADD_FIELDSFields will not be added. Fields specified must already exist in the in_dataset parameter value. This is the default.
  • ADD_FIELDSFields will be added if they do not exist. You must specify the names of the fields to add in the creator_field, creation_date_field, last_editor_field, and last_edit_date_field parameters.
Boolean
record_dates_in
(Optional)

Specifies the time format in which the created date and last edited date will be recorded.

  • UTCDates will be recorded in UTC. This is the default.
  • DATABASE_TIMEDates will be recorded in the time zone in which the database is located.
String

Derived Output

NameExplanationData Type
out_dataset

The modified input dataset.

Dataset

Code sample

EnableEditorTracking example (Python window)

The following Python window script demonstrates how to use the EnableEditorTracking function 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
import 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.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics