Select to view content in your preferred language

AGOL unable to enable editor tracking

4821
12
Jump to solution
02-26-2017 11:13 PM
Trippetoe
Occasional Contributor III

I have created an AGOL hosted feature service.  When I try to enable editor tracking by selecting the 'Keep track of who created and last updated features' checkbox, I get the following error message when clicking the Save button:  "Unable to update feature service definition". And that is all......

The AGOL hosted feature service contains a single feature class and three related tables. The service was published from an 'SDE' instance. That source database had editor tracking enabled on the feature class and tables. I disabled editor tracking in the SDE instance just prior to publishing to AGOL to preserve the created/edited data as the hosted feature service was being created.

In addition to trying to enable editor tracking on the AGOL feature service by clicking on the check-box, I have also tried using the REST admin endpoints on the feature service and the feature class layer.  I have tried to 'Update Layer Definition' and 'Update Service Definition' by setting the edit fields info with the following JSON element:

"editFieldsInfo" : {
  "creationDateField" : "CreationDate",
  "creatorField" : "Creator",
  "editDateField" : "EditDate",
  "editorField" : "Editor"
  }

The REST response indicates 'success' but the update is not persisted.  I have also tried the 'Add to Definition' REST endpoint. The response from there also seems to indicate success, i.e. no error error messages are displayed. But again the additional element is not preserved in the service definition.

I am the owner of the feature service.

Any thoughts on how to enable editor tracking on my AGOL hosted feature service?

0 Kudos
12 Replies
KellyGerrow
Esri Frequent Contributor

Okay,

Are the existing edits made be users that are ArcGIS Online users or are they users that belong in your SDE user base?

Can you confirm that this is your desired workflow:

Take data from SDE database with existing editor tracking and publish to ArcGIS Online, maintaining the existing editor tracking value.

-Kelly

0 Kudos
Trippetoe
Occasional Contributor III

Hi Kelly.

The existing edits are made by ArcGIS Online users that belong to our Organization.

Yes - you have the workflow correct.

0 Kudos
Trippetoe
Occasional Contributor III

Hey Kelly.

I got what i was after by going the python route that you suggested in this forum posting: Publishing to AGOL overwrites editor tracking data 

I shared my SDE data as a service definition file, uploaded that sd document to AGOL, and then used the python script below to publish the data. All the editor tracking data was preserved.  Many thanks to you and Leon Scott

import arcgis
from arcgis.gis import GIS
gis = GIS("http://drcmetro.maps.arcgis.com", "user.name", "password")
sd_items = gis.content.search("owner: user.name AND title: service.title", item_type="Service Definition")
pub_params = {"editorTrackingInfo" : {"enableEditorTracking":'true', "preserveEditUsersAndTimestamps":'true'}}
sd_item = sd_items[0]
sd_item.publish(publish_parameters=pub_params, overwrite="true")
0 Kudos