Skip to main content
2 of 2
formatted the code
Andrey Markeev
  • 16.3k
  • 3
  • 41
  • 70

GetListItemChangesSinceToken query returns "Value does not fall within the expected range."

The following statement returns "Value does not fall within the expected range." when the query argument is filled in. If it is set to null, the call works fine.

XmlElement data = (XmlElement)listsObject.GetListItemChangesSinceToken(listGUID, null, query, viewFields, null, queryOptions, null, contains);

The query argument contains the following code:

<Query>
  <Where>
    <Eq>
      <FieldRef Name="Status" />
      <ValueType Type="Text">Approved</ValueType>
    </Eq>
  </Where>
  <OrderBy>
    <FieldRef Name="Status" />
  </OrderBy>
</Query>

Any idea why this happens?