2012-05-08

I have a need to get collection of SPLitsItem currently viewed to user. My solution is a ribbon button which calls custom application page in LAYOUTS via javascript in custom action.
Application page gets current view id and current folder url via query string. I am using next code to get list items:

Everything is fine on my single-server dev machine, however on our test environment (two WFE's and one database server) I've got COM exception: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)). Here are logs:

I checked view on test environment and noticed that this error appears only when GroupBy is used in corresponding Caml query. This is it:

I've created same view on my machine and didn't get any errors. Also I tried to remove GroupBy entries from query and it works fine.

Here on sharepoint.stackexchange.com I found related question SPSiteDataQuery throwing exception while setting it's Query property I tried to add fields used in GroupBy and OrderBy to ViewFields but it doesn't help.

I'm very unhappy with this error - I don't know how to fix it and Google didn't help me. However the same logic is used on client side via javascript client object model and it works fine.

My first conclusion is that our test environment has some problems. Could you give me any advice how to fix it or do my task alternatively?

Show more