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>
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
@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
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
1 Asked on October 25, 2021 by marko-farkas
1 Asked on October 25, 2021 by sree-kuttan
1 Asked on October 25, 2021 by lukas-liuas
1 Asked on October 25, 2021 by user90269
1 Asked on October 25, 2021
0 Asked on October 25, 2021 by spdevadmin
1 Asked on October 25, 2021 by newone
1 Asked on October 25, 2021
1 Asked on October 25, 2021
2 Asked on March 8, 2021
1 Asked on February 26, 2021 by i-junior
3 Asked on February 25, 2021 by taruki_ms
audience targeting modern experience office 365 quick links sharepoint online
2 Asked on February 24, 2021
1 Asked on February 21, 2021 by maanoj-kumar
microsoft forms office 365 onedrive for business power automate sharepoint online
1 Asked on February 21, 2021
2 Asked on February 19, 2021 by user1258
2 Asked on February 18, 2021 by kmo
2 Asked on February 18, 2021 by hushhoney
Get help from others!
Recent Questions
Recent Answers
© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP