Tuesday 22 April 2014

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator
Error: This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator
Solution: Add some filters to get the data, so that it will work.
Or Create new view with some filters then give the source as new view.
Or Delete some of the records from list view if there are any unused data, then it will work.

Or Add Filter on top of your existing query...

EX:

MyQuery = "<Query>"
+"<Where><And><Gt><FieldRef Name=\"ID\" /><Value Type=\"Counter\">0</Value></Gt>"
+ Query
+"</And></Where>"
+"<OrderBy>"
+"<FieldRef Name='ID' Ascending='False' />"
+"</OrderBy>"
+"</Query>";
How this one will work is: Every List will be indexed with Default Column that is : ID
So when you add <Gt><FieldRef Name=\"ID\" /><Value Type=\"Counter\">0</Value></Gt> this will get the data from SQL with indexed way, so there won't be any time delay....Now u will not get : view threshold error.