Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Using Sharepoint Client Object Model with large libraries (more than 5000 elements)

$
0
0

Hi,

i have issue with acccessing large list with more than 5000 elements. I use a Sharepoint Client Object Model. 

It worked till yesterday when in the list was less than 5000. Now there is in the library more than 5000 elements. I have changed in the Central Administration limit for list from 5000 to 10000, but it helped only for list views. Script returns now 0 records.

var clientContext = new SP.ClientContext.get_current();
	var currentListId =_spPageContextInfo.pageListId;
	oList = clientContext.get_web().get_lists().getById(currentListId);
	var camlQuery = new SP.CamlQuery();
	camlQuery.set_viewXml('<View Scope=\"RecursiveAll\">'+
						'<Query>'+
							'<Where>'+
								'<And>'+
									'<Eq><FieldRef Name=\"ContentTypeId\"/><Value Type=\"Text\">'+contentTypeId+'</Value></Eq>'+
									'<And>'+
										'<Eq><FieldRef Name=\"_x0040_Client\" LookupId=\"TRUE\" /><Value Type=\"Lookup\">'+client+'</Value></Eq>'+
										'<Eq><FieldRef Name=\"_x0040_Company\" LookupId=\"TRUE\" /><Value Type=\"Lookup\">'+organisation+'</Value></Eq>'+
									'</And>'+
								'</And>'+
							'</Where>'+
						'</Query>'+
						'<ViewFields>'+
							'<FieldRef Name=\"ID\" />'+
						'</ViewFields>'+
						'</View>'+
						'<RowLimit>100</RowLimit>');
	camlQuery.ViewAttributes = "Scope='RecursiveAll'";
	listItems = oList.getItems(camlQuery);
    clientContext.load(listItems);
	clientContext.executeQueryAsync(Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed));

Please advice how i can resolve this issue. Thanks a lot!!



from MSDN forum...


Viewing all articles
Browse latest Browse all 7589

Trending Articles