Thursday, 12 June 2014

SharePoint CAML Query on Choice fields


<Where>
<Contains>
<FieldRef Name='MyField'/><Value Type='Choice'>Pending</Value>
</Contains>
</Where>
Or
<Query>
<Where>
<Eq>
<FieldRef Name="Status"></FieldRef>
<Value Type="Choice">
Approved
</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Status"></FieldRef>
</OrderBy>
</Query>