I had a problem with using Contain filter in CAML query in csom, this is my code :
var siteUrl = "/rp/lab/ssite";
var listname = "listview";
var clientContextSO = new SP.ClientContext(siteUrl);
var oListSO = clientContextSO.get_web().get_lists().getByTitle(listname);
var camlQuerySO = new SP.CamlQuery();
camlQuerySO.set_viewXml('<View><Query><ViewFields><FieldRef Name="ID"/><FieldRef Name="Title" /></ViewFields>\
<Where>\
<Contain>\
<FieldRef Name="column1"/> \
<Value Type="Text">aa</Value>\
</Contain>\
</Where>\
</Query><RowLimit>100</RowLimit></View>');
var collListItemSO = oListSO.getItems(camlQuerySO);
clientContextSO.load(collListItemSO);
clientContextSO.executeQueryAsync(Function.createDelegate(this, function (sender, args) {
var listItemEnumeratorSO = collListItemSO.getEnumerator();
while (listItemEnumeratorSO.moveNext()) {
var olistItemEnumeratorSO = listItemEnumeratorSO.get_current();
console.log(olistItemEnumeratorSO.get_item('Title'));
}
}), Function.createDelegate(this, function (sender, args) {
console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}));
This code works fine with Eq
filter but When i use Contain this error happened :
Value does not fall within the expected range.