2

CAML makes me sad some days. Can someone point me in the right direction for the syntax in regards to a CAML query that would evaluate where X= A&B&C&D. My nesting is all off i'm assuming.

<Where>
<And>
<Eq><FieldRef Name="Status" /><Value Type="Text">A</Value></Eq>
<Eq><FieldRef Name="Region" /><Value Type="Text">B</Value></Eq>
<And>
<Eq><FieldRef Name="BagVal" /><Value Type="Text">C</Value></Eq>
<Eq><FieldRef Name="SumVal" /><Value Type="Text">D</Value></Eq>
</And>
</And>
</Where>
1

1 Answer 1

6

Yes, it's your nesting. Try this:

<Where>
  <And>
    <Eq><FieldRef Name="Status" /><Value Type="Text">A</Value></Eq>
    <And>
      <Eq><FieldRef Name="Region" /><Value Type="Text">B</Value></Eq>
      <And>
        <Eq><FieldRef Name="BagVal" /><Value Type="Text">C</Value></Eq>
        <Eq><FieldRef Name="SumVal" /><Value Type="Text">D</Value></Eq>
      </And>
    </And>
  </And>
</Where>

You are not allowed to put more than two conditions in a single condition group.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.