I have requirement to filter two fields with substring but I found out that substring is not working in REST API it have some kind of bug. So below question stackexchange.com suggested to use listdata.svc
logical not of substringof() in 2013 REST API
But I cannot use two fields at the same time with listdata.svc. So I decided to use CAML Query with spservices jquery but there paging is not working.
Below is my code
var news = ''
$().SPServices({
operation: 'GetListItems',
async: false,
webURL: _spPageContextInfo.siteAbsoluteUrl,
listName: 'News',
CAMLQuery: `<Query>
<Where>
<And>
<Or>
<Contains>
<FieldRef Name='Title' />
<Value Type='Text'>KFH</Value>
</Contains>
<Contains>
<FieldRef Name='Detail' />
<Value Type='Note'>KFH</Value>
</Contains>
</Or>
<Eq>
<FieldRef Name='Active' />
<Value Type='Choice'>Yes</Value>
</Eq>
</And>
</Where>
<OrderBy>
<FieldRef Name='PublishDate' Ascending='False' />
</OrderBy>
</Query>`,
CAMLViewFields: `<ViewFields>
<FieldRef Name='Title' />
<FieldRef Name='Detail' />
<FieldRef Name='PublishDate' />
<FieldRef Name='ID' />
<FieldRef Name='Attachments' />
</ViewFields>`,
CAMLRowLimit: 6,
CAMLQueryOptions:
"<QueryOptions><Paging ListItemCollectionPositionNext='" +
newpos +
"'><QueryOptions>",
completefunc: function(xData, Status) {
pos = $(xData.responseXML)
.find("[nodeName='rs:data']")
.attr('ListItemCollectionPositionNext')
$(xData.responseXML)
.SPFilterNode('z:row')
.each(function() {
news = 'HTML CODE'
$('#news').append(news)
})
},
})
I don't know but CAMLQueryOptions never works and never works paging. Please help for forward paging