How to use the Update Definition operation on a hosted layer view in AGOL

3158
11
Jump to solution
05-17-2018 12:11 PM
Trippetoe
Occasional Contributor III

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:

Invalid definition for 'DefinitionQuery'.
Invalid definition for System.String

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?

11 Replies
ChristopherCounsell
MVP Regular Contributor

Can you contact tech support? They closed this bug as non-reproducible. I feel like you and I and others hit this page and assume it's a bug but no one contacting support.

The issue is reproducible for my on the layer definition (i.e. featureserver/0, /1, /2 etc) but it looks like it's not reproducible on the parent service (featureserver/). So a good workaround may be to update the service definition. Either way would be good if you can touch base with support so we can have this issue properly reognized if it's still a thing.

0 Kudos
ChristopherCounsell
MVP Regular Contributor

BUG-000114175 has been closed as 'non-reproducible'.

BUG-000155365 has been opened.

The error does not occur for the 'update service definition', i.e. when you do it at the root layer level. 

The error does occur for the 'update layer definition', i.e. when you go into one of the sublayers of the service and try to update there.

Esri had closed off this issue however long ago but it's now been reopened as BUG-000155365. Please contact support and attach yourself to this issue if you continue to encounter it.

I believe it should be possible to update the sublayer definitions through the service definition - we should be able to workaround the error this way instead of having to remove the definition query.

@ArmstKP FYI