Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Query Expression Add Criteria for look up field and optionset.

$
0
0

Hey guys, i m trying to get data from field with one criteria.
For example: 

QueryExpression query = new QueryExpression { EntityName = "Account", ColumnSet = new ColumnSet("accounttype") };
                    query.Criteria.AddCondition("location", ConditionOperator.Equal, "India");


The field of location is optionset. I tried to run this code, but its keep giving me error message. When i tried to change the condition to a field with single line of text type. Its work  !!

im wondering that my code can't get value from field except single line of text, multiple text and number. 
So my question is, how can i add criteria from a optionset type of field and lookup type of field


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>