How to check checkboxes in caml query?
In SharePoint 2010 client object model (JavaScript), I am using this caml query to download list items.
There is a column called 'Office'
and in it, there are several check boxes (ie its a multi-select field). I am looking to get the items where the checkbox in the Office
field, that has the name 'Toronto'
is checked. I don't want to consider the values of the other checkboxes in the Office
field. This query below is not working though because I am getting 0 items, when I know I should be getting more.
var camlquerystring = "
<View>
<Query>
<Where>
<Eq>
<FieldRef Name='Office'/>
<Value Type='Boolean'>
Toronto
</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name='Modified' Ascending='FALSE' />
</OrderBy>
</Query>
</View>";
Does anyone know what is wrong?
Thanks.
I got the solution:
Change <Value Type='Boolean'>
to <Value Type='Text'>
or <Value Type='MultiChoice'>
.
Source: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentprevious/thread/b20b1945-4b73-4320-8666-957650dc6a20
链接地址: http://www.djcxy.com/p/64144.html上一篇: 包含空字符串
下一篇: 如何检查caml查询中的复选框?