Sunday, February 22, 2015

CAML Query - 3 AND 's in 1

It's pretty easy to deal with two conditions in CAML query. A newbie would find it to be a bit tricky when it comes to more than two. CAML has it's own way of grouping conditions. Below is a sample showing how to do it.

<Where>
<And>
<And>
<Eq>
          <FieldRef Name='_ModerationStatus'/>
          <Value Type='String'>Approved</Value>
</Eq>
<Neq>
<FieldRef Name='ContentType' />
<Value Type='Text'>Folder</Value>
</Neq>
</And>
<Neq>
<FieldRef Name='******' />
<Value Type='Text'>*****</Value>
</Neq>
</And>
</Where>




No comments:

Post a Comment