When I run the following query I get an error:
<View><Query><Where>
<Or><Eq><FieldRef Name='ID'/><Value Type='Number'>164</Value></Eq>
<Or><Eq><FieldRef Name='ID'/><Value Type='Number'>166</Value></Eq>
<Or><Eq><FieldRef Name='ID'/><Value Type='Number'>154</Value></Eq>
<Or><Eq><FieldRef Name='ID'/><Value Type='Number'>165</Value></Eq>
</Or></Or></Or></Or></Where></Query><RowLimit>50</RowLimit></View>
I've also tried:
<View><Query><Where><Or>"
<Eq><FieldRef Name='ID'/><Value Type='Number'>164</Value></Eq>
<Eq><FieldRef Name='ID'/><Value Type='Number'>166</Value></Eq>
<Eq><FieldRef Name='ID'/><Value Type='Number'>154</Value></Eq>
<Eq><FieldRef Name='ID'/><Value Type='Number'>165</Value></Eq>
</Or></Where></Query><RowLimit>50</RowLimit></View>
It also fails. and before that I tried using In:
<Query><Where><In><FieldRef Name='ID'/><Values> <Value
Type='Number'>166</Value><Value
Type='Number'>165</Value></Values></In></Where></Query>
And that returns all the items. Not the ones "In" my provided query.
What I want is to be able to build my caml query from the selected items. I've managed to get Ids of the selected items and now I want to load my list object with the list properties that I need (clientContext.load(listItems, 'Include(Id, Title,
...,...)') ).
I'm stuck with the caml query that I trying to build dynamicly. Can anyone spot what I'm doing wrong?