0

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>
2
  • <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>
    – Marta
    Sep 16, 2020 at 14:27
  • Is it SharePoint online or SharePoint on-premise? If it's on-prem, threshold can be disabled on a particular list using PS script. Sep 16, 2020 at 21:14

4 Answers 4

0

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

1
  • i don't think you can do it for SPO the question carries tag Sep 17, 2020 at 13:54
0

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() 

1
  • i don't think you can do it for SPO the question carries tag Sep 17, 2020 at 13:54
0

@Marta,

This is a known issue called list view threshold. Below blogs explains this issue in detailed:

To acquire all sub folers(or files) in a specified folder using caml, please refer to below thread:

BR

0

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.