In an SPQuery, which fields are required to update a list item?
SPQuery query = new SPQuery();
query.Query = @"
<OrderBy>
<FieldRef Name='ID' Ascending='true' />
</OrderBy>";
query.ViewFields = string.Concat(
"<FieldRef Name='ID' />",
"<FieldRef Name='Title' />");
query.ViewFieldsOnly = true;
query.RowLimit = 2000; // Effective batch size.
query.QueryThrottleMode = SPQueryThrottleOption.Override;
If I run listItem.Update()
without changing any fields, the update fails with the error 'value does not fall within the expected range'
. But if I change ViewFieldsOnly
to false, the update succeeds. My question is which fields are required to update a list item successfully (excluding any fields that may have been changed)?