Or clause in CAML query behaving like And clause

I have a custom content type in the Pages library of a publishing site, which contains two multi-value taxonomy fields. I'm trying to write a CAML query that will return any items from the Pages library that contain specific values in either of those taxonomy fields, i.e. return any items where taxonomy field 1 = 'X' or taxonomy field 2 = 'Y', so I'm using In clauses within an Or clause in my CAML query. The weird thing is that the In clause appears to be behaving like an And clause. For example the following CAML query only returns items when both the NewsLocation field contains the value in the first In clause AND the OperatingCompany field contains the value in the second In clause.

<Where>   <Or>     <In>       <FieldRef LookupId='True' Name='NewsLocation' />       <Values>         <Value Type='Integer'>1</Value>       </Values>     </In>     <In>       <FieldRef LookupId='True' Name='OperatingCompany' />       <Values>         <Value Type='Integer'>3</Value>       </Values>     </In>   </Or> </Where> 

Have I got the CAML syntax wrong, or is there an issue with how In clauses work in Or clauses?


Category: sharepoint enterprise Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.131 (s). 12 q(s)