Reputation: 43
i have three sharepoint list Region,country State. Region is foreign list to country and country is foreign list to states.
so how can i get state with some region with caml expression
Upvotes: 0
Views: 5622
Reputation: 22580
This can be done in CAML, provided you use Sharepoint 2010 &
There are requirements to keep in mind when creating list joins. You cannot join just any two lists, regardless of type. And if two lists can be joined, not just any primary and foreign field can be used as the “join on” pair of fields. The field in the primary list must be a Lookup type field and it must lookup to the field in the foreign list. For this reason, all joins mirror existing lookup relations between lists.
For more information please see the following documentation link:
MSDN Documentation on Sharepoint 2010 JOIN in CAML
Upvotes: 2
Reputation: 235
There's no way you can do this in a CAML way, instead you could try to do this in tree different ways:
1.- Linq to SharePoint http://msdn.microsoft.com/en-us/library/ee538250.aspx
2.- Use SPSiteDataQuery http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.lists.aspx
3.- Do tree CAML querys, one for each data source, add each data source to a different list, join those lists with Linq or do some magic stuff with your coding.
Use Caml Builder or Stramit Caml Query, those tools will be very useful for you.
Best regards!
Upvotes: 0