Problem: SharePoint site gave "System.ArgumentException: Value does not fall within the expected range" error!
Here are some possible root causes and solutions
Case 1: While fetching List item Lookup values programmatically
Root cause: List view threshold value Exceeded! This occurs due to throttling limit on list view lookup threshold value under web application settings. Try increasing it.
- Go to Central Administration >> Application Management >> Manage web applications
- Select your web application, Click on General Settings >> Resource Throttling from the ribbon
- Enter the value for List View Lookup Threshold. E.g. 36
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $WebApp = Get-SPWebApplication "http://sharepoint.crescent.com/" #Set List View Lookup Threshold $WebApp.MaxQueryLookupFields = 36 $WebApp.Update()
Case 2: Invalid Field Names
When fetching fields, use internal field names or check whether the particular field exists before trying to get its value. E.g. Use item.Fields.ContainsField("Title") before fetching or updating a specific field. So, if you got this error after activating a feature or deploying a solution, culprit is your recent feature/solution!
Case 3: During Check-In under SharePoint Document Library:
Got this error while checking in a document ? Well, the solution is simple - Do not set required field property to true on your content types!
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.