Friday, May 29, 2009

SharePoint: CAML Query - AND

I was ANDing three SharePoint fields in CAML Query based on the regular logic (place And between all three fields) and was getting errors with absolutely no clue that what possibaly could be wrong.
Here is the right way...thanks to Google:

Target: field1 && field2 && field3
Correct CAML:

        <fieldref name="field1">
        <value type="Text">val1</value>
        <fieldref name="field2">
        <value type="Text">val2</value>
      <fieldref name="field3">
      <value type="Text">val3</value>

Happy CAMLing!

No comments:

Post a Comment

Official SharePoint Documentation

I have recently contributed to the official SharePoint documentation for developement. Check it out here: