TransWikia.com

Exceeds Threshold

SharePoint Asked on December 25, 2020

When I use a query with where clause, my app throw this exception:

"ExceptionMessage":"The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator."

<View Scope='RecursiveAll'><RowLimit>1000</RowLimit>
<Query>
<Where><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq>
</Where>
</Query>
<ViewFields><FieldRef Name = 'ID' /><FieldRef Name = 'Title' /><FieldRef Name = 'WebSeguros_DocumentoID' /><FieldRef Name = 'WebSeguros_ADM_ID' /><FieldRef Name = 'WebSeguros_TipoDocumento' /><FieldRef Name = 'Created' /><FieldRef Name = 'Author' /><FieldRef Name = 'Modified' /><FieldRef Name = 'Editor' /><FieldRef Name = 'FileLeafRef' /><FieldRef Name = 'FileDirRef' /></ViewFields></View>

4 Answers

The problem you have is that even though you're trying to limit the number of rows returned to 1000 (under the view threshold), the query has to address all the items due to the Where clause you're using. The 'FSObjType' column is not indexed.

It looks like all you're trying to do is return all items, excluding folders. If so, there's a better way: Instead of using a Scope of "RecursiveAll", which returns all items and folders, just use a Scope of "Recursive", which returns only items and not folders. You can then remove the Where clause. So:

<View Scope='Recursive'><RowLimit>1000</RowLimit>
<ViewFields><FieldRef Name = 'ID' /><FieldRef Name = 'Title' /><FieldRef Name = 'WebSeguros_DocumentoID' /><FieldRef Name = 'WebSeguros_ADM_ID' /><FieldRef Name = 'WebSeguros_TipoDocumento' /><FieldRef Name = 'Created' /><FieldRef Name = 'Author' /><FieldRef Name = 'Modified' /><FieldRef Name = 'Editor' /><FieldRef Name = 'FileLeafRef' /><FieldRef Name = 'FileDirRef' /></ViewFields></View>

Answered by maximon on December 25, 2020

Answered by Baker_Kong_MSFT on December 25, 2020

For SP on-prem, you can disable the threshold for a specific list or library using PS Script

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$WebApplication = Get-SPWeb “https://WebURL/sites/abc/siteA/”
$List = $WebApplication.Lists["My List"]
$List.EnableThrottling = $false
$List.Update() 

Answered by Matiur Rahman on December 25, 2020

You Can increase the list view threshold to solve this problem : 1- Go to Central Admin 2-Under “Application Management” click “Manage Web Applications” 3-Select the web application for which you’re adjusting the list view threshold 4-from the upper menu inSelect “General Settings” then “Resource Throttling” 5- in the list view threshold : change the limit ex: enter 1000

Then it will work

Answered by Mohamed Ragab on December 25, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP