My project uses the 2010 version of the Sharepoint Filtered Lookup Field, which has the option to filter a column using a caml query.
So I have three lists: Categories, SubCategories and MainList.
Categories is just a plain list.
SubCategories is a list with two columns: Title
and Category
where Category
is a regular lookup column leading to the Categories list.
MainList has a column for Category
and for SubCategory
- but SubCategory
is supposed to filter on Category
.
So I want to write a CAML query that filters the SubCategories
list. It should show only those SubCategories where [Title] is equal to the Category.
<Query>
<Where>
<Eq>
<FieldRef Name="Category"/>
<Value Type="Text">[Title]</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Title" />
</OrderBy>
</Query>