Warm tip: This article is reproduced from serverfault.com, please click

SharePoint: Value does not fall within expected range

发布于 2020-12-02 09:41:39

Using CSOM to get data from SharePoint. After adding new fields to a list I get the "Value does not fall within expected range" error when trying to retrieve items from a list. I use the Include statement to include fields

Example

icon => icol.Include(
i => i["Field1"],
i => i["Field2"],
i => i["SomeNewField"])

When I add the SomeNewField I get the error. Thought it was about null values but even when I add a record where SomeNewField has a value the error occurs.

Any ideas

Questioner
Søren Solberg
Viewed
0
Amos 2020-12-03 10:53:06

You need to add the new field into the caml query XML.
Error: enter image description here Success: enter image description here