I am trying to use the Update Definition operation on a hosted feature layer view through the Admin view of the REST endpoint of the feature service. The change i am trying to make is setting some default values in the 'templates' element. However, regardless of the changes i try to make to the definition, i am getting the following error message:
Even for the simplest change of setting "lastEditDate" : " ", I get the error message. I am the owner of the view.
The definition query (as generated by AGOL when creating the view) looks like this:
{
...
"viewDefinitionQuery" : "(IsActive = 'Yes') AND (CaseType = 'Report') AND (ReportStatus = 'Received')",
"definitionQuery" : "(IsActive = 'Yes') AND (CaseType = 'Report') AND (ReportStatus = 'Received')"...
}
Any thoughts on what's going on?
Solved! Go to Solution.
The issue appears to be with having a Definition Query applied to the Feature Layer View when attempting to update its 'definition.'
In case anyone else encounters this error message, here is a workaround that was successful for me:
Esri Tech Support has verified that this is a bug in AGOL. The bug number is #BUG-000114175
Is the bug the whole method of using Update Layer Definition?
Or is the bug related to this poster's Def Qry only?
I'm running into similar problem trying to update a field to nullable = false.
The issue appears to be with having a Definition Query applied to the Feature Layer View when attempting to update its 'definition.'
In case anyone else encounters this error message, here is a workaround that was successful for me:
I had the same exact issue as described by Tom Rippetoe and this 3-step process worked like a charm. I hope there's a bug fix coming soon on this or at least a more useful error. Anyway, in my opinion this should replace the current Correct Answer as it provides an actual workaround rather than a link to a promise of fix. Thank you for sharing, John Marino!
Works for me. i updated the correct answer.
Thanks for sharing that information John. That is the best part of GeoNet!!!!
How do you carry out the first step? "remove all definition queries for the feature layer view"
Steps that worked for me:
{
"viewDefinitionQuery" : "(field1 = 12345) AND (field_name_two = 'bobsyeruncle')",
"definitionQuery" : "(field1 = 12345) AND (field_name_two = 'bobsyeruncle')"
}
{
"viewDefinitionQuery" : "(field1 = 98765) AND (field_name_two = 'slurm is tasty')"
}
This bug still exists as of today.