AnsweredAssumed Answered

Feature Layer setDefinitionExpression issue with LIKE operator and wildcards

Question asked by jwoodburn77 on Oct 9, 2014
Latest reply on Oct 10, 2014 by jwoodburn77

I'm running into an issue with setDefinitionExpression on a Feature Layer... If the value starts with a wildcard, all features will be returned (basically, the definition expression is not applied - if the layer has a default expression, that will still be applied). So, I'm doing something like this:

 

featureLayer.setDefinitionExpression("FACILITYID LIKE'%a%'");

OR

featureLayer.setDefinitionExpression("FACILITYID LIKE'%a'");

 

This expression works in query tasks and when applied as a definition query for the service layer, so I'm thinking this is a bug with the API, but maybe I'm missing something.

 

Also, the following works, so this appears to fail only when the value starts with a wildcard:

 

featureLayer.setDefinitionExpression("FACILITYID LIKE'a%'");

 

Any ideas?

 

Thanks,

Jim

Outcomes