Need to write a CAML Query that filters against a Lookup Column?

by Shawn 12. January 2012 07:08

There are two options to do this -- one is based on the value and the other on the ID.  Unfortunately MSDN doesn't provide any help at all on the 2nd option.

Standard what (based on value):

<Where>
    <Eq>
        <FieldRef Name=”Category” />
        <Value Type=”Lookup”>My category</Value>
    </Eq>
</Where>

And by ID:

<Where>
    <Eq>
        <FieldRef Name=”Category” LookupId=”TRUE” />
        <Value Type=”Lookup”>234</Value>
    </Eq>
</Where>

Tags: ,

SharePoint

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Powered by BlogEngine.NET 2.5.0.6
Theme by Mads Kristensen | Modified by Mooglegiant

About the author

As an individual with a passion for technology and knolwedge I have long enjoyed being part of the computer industry as both a systems architect and infrastructure engineering.  This blog is way for me to share some thoughts. ideas, and ponderings on all of these things.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Calendar Of Posts