Error: Unable to update feature service layer definition. Invalid definition for 'lastEditDate'
In ArcGIS Online, users can modify the schema of a layer inside of a hosted feature service by updating the service definition. The Update Definition operation is accessed through the Admin view of the REST endpoint of the feature service. Such updates include updating maximum record count and modifying the coded value domains for the hosted feature service.
In some instances, when attempting to alter the JSON and Update Layer Definition of a feature service, the operation fails and the following error message is returned:
Error: Invalid definition for 'LastEditDate'. Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo
This error message is returned because the numeric value exists inside the lastEditDate property. This property displays an epoch value used internally by the Open Data initiative and cannot be set to a numeric value when updating the schema. An example of this is below:
Solution or Workaround
Set the value of lastEditDate to anything but a number. Follow the steps below to solve this issue.
- Log in to www.arcgis.com with administrator credentials.
- Click My Content, and navigate to the intended feature service. Open the feature service.
- In the Item Details page of the feature service, click Service URL under Layers. The ArcGIS REST Services Directory page opens.
- Modify the URL using the example below, appending '/admin' between 'rest' and '/services':
- Press Enter to access the ArcGIS REST Administrator Directory.
- Scroll to the bottom of the page to view the Supported Operations list, and click Update Definition.
- Make the intended changes to the JSON of the feature service.
- Change the lastEditDate key value by replacing the string of numbers, which indicates the last edit date, to double quotation marks with no content quoted between them (“ “).
- Click Update Layer Definition to save the changes.
- ArcGIS Blog: Updating Hosted Feature Services in ArcGIS Online
- ArcGIS REST API: Update Definition (Feature Service)
- ArcGIS REST API: Update Definition (Feature Layer)