Locking fields in ArcGIS to maintain integrity of last_edited_user field

4680
5
02-03-2015 08:45 AM
GeoffreyWest
Occasional Contributor III

I have a Collector for ArcGIS application which records the last_edited_user from the field, however post-processing needs to occur and overwrites my users from the field to my desktop user. Is there a way to lock the last_edited_user to maintain my initial edited user? I am using ArcGIS For Server 10.2.1 and SQL Server Database 2008 R2.

5 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Geoffrey,

Before your post-processing, you can Disable Editor Tracking.  After the post-processing is finished, you can then Enable Editor Tracking.  This workflow will not affect the editor tracking from the field collectors.

GeoffreyWest
Occasional Contributor III

This sounds like the likely solution, my post-processing is in the form of a field calculation and a search cursor in a python script.  From a conceptual point of view, would I disable editor tracking at the beginning of the script and enable at the end?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

From a conceptual point of view, would I disable editor tracking at the beginning of the script and enable at the end?

Yes, that is correct.

GeoffreyWest
Occasional Contributor III

This leads to another caveat, since this feature class is consumed by a feature service, it is locked and I receive this error. 

EDIT: if I use arcpy.disconnectusers it stops my feature classes.

Traceback (most recent call last):

  File "C:/PeterScripts/Harbor.py", line 56, in <module>

    arcpy.DisableEditorTracking_management(SDEFeatureClass)

  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 3529, in DisableEditorTracking

    raise e

arcgisscripting.ExecuteError: ERROR 000464: Cannot get exclusive schema lock.  Either being edited or in use by another application.

Failed to execute (DisableEditorTracking).

0 Kudos
JakeSkinner
Esri Esteemed Contributor

You can disable schema locking on the service:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

0 Kudos