I followed the directions here:
Updating Hosted Feature Services in ArcGIS Online | ArcGIS Blog
to update a hosted feature service in AGOL.
But, I came across this error:
Invalid definition for 'LastEditDate'. Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo
So, I found this article describing a workaround:
Error: Unable to update feature service layer definition. Invalid definition for 'lastEditDate'
I did what was described in the article:
But, the feature service did not update. It reverted back to the last state.
Has anyone come across this issue? Is there an actual workaround or am I just stuck with what I have?
thanks.
Solved! Go to Solution.
Hi Catherine,
What are you trying to update in the service definition?
Hi Kelly!
What I was trying to do was change the field size of a field in a feature service published to AGOL. I followed both sets of instructions Aridain Welsh posted with his original question because I was experiencing the same problem he was Invalid definition for 'LastEditDate'.
Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo
I implemented the workaround Adrian found and that fixed that problem.
I also deleted all the features in the published feature service like the post suggested that I found (see above).
After doing all of that I experienced what everyone here in this post was experiencing. Every time I selected "Update Definition" it would return True or Successfully Completed based on what I selected (I was trying any combination to see if something would change) but nothing would change.
Thank you!
I'm having the same problem, it used to be new choices could be added to a domain for the drop downs when editing or field collection, then i was getting the error, but it's not consistently happening ??
Update, no longer a problem
I am also having the same problem. I am trying to change the default value instead "null". I also put in the blank double quotes for the last edit date. It comes back with no error, however, it resets to the null default value. Has anyone been successful with this?
Default value or field size cannot be changed once you add the field. It is defined only when you create the field. Only field visibility, alias, domain can be changed using the layer updateDefinition admin API. You can however add a new field with the desired property including default value/size and then use the layer Calculate API to assign the new field to the old field and delete the old field.
Also you do not need to set any value for lastEditDate or even add to the definition you need to change. The only accepted value for lastEditDate is null which would update the lastEditDate of the layer to the current date.
"lastEditDate" : null.
Khaled
Thank you for answering, Khaled. Once I create a new field, define the default value, and populate the field by using the Calculate field, the default is changed back to none. Any ideas? Should this be done in Desktop and not AGOL?
Yes you can do it on online and we should honor it in online feature service fields. However, we have a bug currently in ArcGIS Online where we only honor a default for the field of type esriFieldTypeString. This bug is scheduled to be fixed in September 2019 update,(scheduled ~ next week). The bug will still be there is you use the desktop. So I hope you can wait until next week and verify this is working for you.
There are options now in AGOL that make changes to uploaded feature services much easier. Instead of going through the process of the admin/service route, you can add fields or add to domain choices easily on the feature service definition page by going to the Data tab => Field. So Much easier. Shout out to Derek Law dlaw@ESRI for showing me this
Thanks for pointing this out. When I ever get back to a project like this, I'll be sure to reference this thread again!
FYI: Please note the data tab UX in the AGOL uses indirectly the feature service admin API to apply the changes. So the rules and the restriction of changing the field size/default value still applies.