AnswerBun.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!

Related Questions

Is there an API or web service for Copy-SPSite?

0  Asked on October 25, 2021 by spdevadmin

     

Calculated Fields and Outputting to Excel

1  Asked on February 28, 2021 by brandon

 

PnP with .NET Core

1  Asked on February 23, 2021 by thomas-segato

   

How can I use MS Web Test to upload files to SharePoint?

2  Asked on February 19, 2021 by user1258

 

Filtering List View by Current User Email

2  Asked on February 18, 2021 by hushhoney

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP