Im trying to construct a CAML query from the current Listview filter settings. I dont know in prior how many filters the user may set.

My goal is to create a CAML query which has the exact same items in scope as the current Listview filter (all items... without paging) to do some complex calculations in Javascript.

I tried to parse the URL-Params (FilterField1=...FilterValue1=...) in Javascript, but its a rather complex task to handle all possibilities.

Somewhere in Sharepoint (Client or Server, I dont know) this functionality must already exist, since clicking the default button "Save this View" does exactly this.

My fallback would be: create a new view from current filter settings (trigger action "Save this View"), derive the CAML query from the new view and delete the view immediatly... but this seems like a very ugly solution to me.

Anybody with a solution or a hint?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.