CAML Query Order By Returns All Records Sharepoint Source

Dec 14, 2010 at 3:13 PM

I have a Sharepoint list setup with 9 different views. The view hierarchy is displayed below:

  • All Items (returns what I want)
  • All Requests (returns records from all time)
  • By County
  • Northeast
  • North
  • Southeast
  • South
  • East
  • West

My understanding from reading the MSDN tutorial with regards to the Sharepoint Source, is that if you leave the SharepointListView property blank, that the component will default to the Default View (the view listed first in the hierarchy). This is perfect for me, because that's the one that I want. And indeed -- if I leave the View property blank, I get the expected results.

However, once I introduce a CAML order by query in the CAMLQuery property, even though I leave the View property blank, I get the results for the All Requests view. I've tried specifying the name of All Items and Default for the View name, both those views do not exist on the Sharepoint list (for some weird reason). I also don't have back-end access to the Sharepoint site/databases; else, I would probably be able to find if the View is named something different or not.

Bottom line is this seems like a bug. If I'm missing something, please let me know. Thanks!

 

 

Dec 15, 2010 at 1:03 PM

Found out the issue with this after searching some blogs:

Turns out that if you include <Query></Query> within the CAML query, then the results that come back are incorrect. Simple remove the <Query></Query> tags from the CAML query and all is good.

Mar 24, 2011 at 12:55 PM

James,  can you post before and after version of the CAML ( I thought you had to use the "Query" tag).