QueryTask CodedvalueDomain values not resolved

550
1
04-04-2011 02:02 PM
cristiansanabria
New Contributor
Hi,

I have the following :
QueryTask queryTask = new QueryTask(currentMapInfo.Url + "/" + parcelsLayerIndex);
queryTask.ExecuteCompleted += new EventHandler<QueryEventArgs>(queryTask_ExecuteCompleted);
queryTask.Failed += new EventHandler<TaskFailedEventArgs>(query_Failed);
Query query = new Query();
  query.Where = "Status LIKE 'Active'";
query.OutFields.AddRange( new string[] { "*" } );
queryTask.ExecuteAsync(query);

as you can see in the query.where I want to use the value of Status but when I execute que query there is not result this happens because Status is a domain so I have to use the value 2 instead of 'Active' is this a bug?? what can I do so that Querytask resolve Domain values???


regards.
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
You can look at this service for example.
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer...

Notice that lifecyclestatus is an integer field that identifies key of coded-value domain.
lifecyclestatus (Type: esriFieldTypeInteger, Alias: Lifecycle Status, Editable: True, Domain: Coded Values: [0: Proposed/Potential], [1: Active/Confirmed], [2: Closed/Completed], ...1 more...)


You can try the following query from your web browser:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer...

You can only use "Status LIKE 'Active'" if Status is a string field and you expect it to match the word 'Active'.
0 Kudos