2

Consider the folowing CAML query:

<Query>
<Where>
    <And>
        <Eq>
            <FieldRef Name="Field1"/>
            <Value Type="Text">Field value 1</Value>
        </Eq>
        <Eq>
            <FieldRef Name="Field2"/>
            <Value Type="Text">Field value 2</Value>
        </Eq>
        <IsNull>
            <FieldRef Name="Field3"/>
        </IsNull>
    </And>
</Where>

SharePoint raises a Microsoft.SharePoint.SoapServer.SoapServerException. What is the problem here?

CBono
  • 3,803
  • 1
  • 32
  • 40
igortche
  • 115
  • 1
  • 8

1 Answers1

1

The "And" element can have only two child elements. So your query could, for example, have this structure, where "And" has "IsNull" plus a nested "And" as child elements.

<Query>
<Where>
     <And>
         <IsNull>
              <FieldRef Name="Field3" /></IsNull>
         <And>
              <Eq>
                    <FieldRef Name="Field1" /><Value Type="Counter">field 1 value</Value>
              </Eq>
              <Eq>
                    <FieldRef Name="Field2" /><Value type="Text">field 2 value</Value>
              </Eq>
         </And>
     </And>
</Where>

This article has some good examples: http://msdn.microsoft.com/en-us/library/ms196939.aspx

Steve Mannina
  • 475
  • 3
  • 11