I have the following problem. I have a list with a custom content type, when programmatically I want get an information from my SPListItem I get the following exception: Value does not fall within the expected range.

If I print all the fields of my item I have the field I looking for. I try to get the data by the GUID, by the internal name and so on, but I receive always the same error.


    private static DateTime GetModified(SPListItem item)
        // I tried it
        //string ultimarevisione = item.GetFormattedValue("MyCustomField");
        if (item[new Guid("{EA440C5B-845D-482F-8D10-666B06851AFE}")] == null)
            return DateTime.Parse(item["StartDate"].ToString());

        return (DateTime)item[new Guid("{EA440C5B-845D-482F-8D10-666B06851AFE}")];

    var field = item.Fields.GetFieldByInternalName("MyCustomField");

    //in this way doesn't work too
    if (item[field.Id] == null)
            return DateTime.Parse(item["StartDate"].ToString());

I got it with a LINQ query

var results = docs.ScopeToFolder(docsList.RootFolder.Url, true)
.Where(p => p.ItemType == SPFileSystemObjectType.File &&
p.ItemType != SPFileSystemObjectType.Folder)                                                                                             
.OrderByDescending(d => d.Modified);
  • 1
    can you show your code? Oct 31, 2012 at 8:49
  • where are you using this code, web part? event receiver, console application? Oct 31, 2012 at 11:06
  • in a class that implement the ICustomMapping interface
    – Gaetanu
    Oct 31, 2012 at 16:55
  • help me guys!!!!
    – Gaetanu
    Nov 2, 2012 at 9:54
  • hi, I am facing similar problem. I tried method 1: using internal name 2. add viewfields in caml query 3. set list view threshold in Resource throttling am I missing something?\ Mar 21, 2017 at 6:07

7 Answers 7


You can retrieve the value by using item.Properties["Name"] instead. We ran into the same problem and while I wasn't able to find a root cause this worked as a fix.

  • 1
    Thanks, Shane! I was so frustrated by this error and your tip fixed it. Weird that it works on every field except this one boolean field. Stupid SharePoint. May 8, 2014 at 14:18

How do you get this SPListItem in the first place? For example, when item is retrieved by CAML query without necessary fields defined in ViewFields section, it may lead to exception when retrieving such a field.


I think that you get SPListItemCollection from SPView, but this SPView does not contains needed field


be sure that you include that field in the viewfields


I suggest you can check the thread: https://stackoverflow.com/questions/17875571/sharepoint-2010-value-does-not-fall-within-the-expected-range

It's refered to the "List View Lookup Threshold" parameter on the Central Administration.


Try to open your List/Item with Sharepoint Manager tool and check exactly what is the correct internal name of your field.

  • I did with power shell, anyway I tried with SPM and the internal name is the same. How you can see I try to get the value by the GUID too
    – Gaetanu
    Oct 31, 2012 at 10:54
  • Something might be happening with the item. Anyway, try this: 'item.Fields["MyCustomField"]' Oct 31, 2012 at 10:55

SharePoint 2013, Central Administration, Select web application, Resource Throttling under ribbonbutton flyout General Settings and change List View Lookup Threshold from 8 to something higher (depending on how much lookup, taxonomy, user, etc fields you have).

Best way to test is add all your fields to the default view and see if it can render.

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.