I am trying to execute the following query:

query.Query =<Where>
  <FieldRef Name='Product' />
 <FieldRef Name='CountryCode4' Ascending='FALSE' />

query.Join = <Join Type='LEFT' ListAlias='ProductList'>
  <FieldRef Name='Product' RefType='Id' />
  <FieldRef List='ProductList' Name='ID' />
<Join Type='LEFT' ListAlias='AuthorisationLookupList'>
  <FieldRef List='ProductList' Name='MarketingAuthorisationLookup' RefType='Id' />
  <FieldRef List='AuthorisationLookupList' Name='ID' />
<Join Type='LEFT' ListAlias='AuthorisationStatusLookupList'>
  <FieldRef List='AuthorisationLookupList' Name='AuthorisationStatusLookup' RefType='Id' />
  <FieldRef List='AuthorisationStatusLookupList' Name='ID' />

When applying sorting the column "CountryCode" is empty and sorting has not taken place. If, however, I sort by the column "Title" everything works fine. Would anybody have a clue as to why and if what I am trying to achieve is even possible?

1 Answer 1



I know this question is quite old, but just came across this post.. If we look at following link, which explains the Limitations of CAML Joins: JOINS AND PROJECTIONS IN SHAREPOINT 2010

It says:


  • There is no way to leverage joins and projections in a view through the UI. CAML must be written. Few things are more badass than CAMLs, but they're often hairy. (Get it...? Maaan I crack myself up)
  • Joins can only be defined on lookup columns
  • Projected fields cannot be used to sort or group in the view
  • Dynamic sorting and filtering in listview webparts is also not supported
  • Projected columns do not show up correctly in datasheet view, or when exported to Excel

Point 3 explains why your query is not working.

  • Ha! Thank you Arsalan for taking the time to answer that old question. Commented Nov 7, 2013 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.