The following code works fine when there is no query but gets error from the service when the caml is sent. the location is the number before the ";#" of value of ows_HRLocations
(I tried "Contains" on the string after but got the same error)
Can anyone Help?
(I tried "Contains" on the string after but got the same error)
Can anyone Help?
function loadFromPages(){
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Pages",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='PublishingPageImage' /><FieldRef Name='Name' /><FieldRef Name='NameTitle' /><FieldRef Name='FeaturedItem' /><FieldRef Name='HRLocations' /></ViewFields>",
completefunc: renderStories,
CAMLRowLimit: 100
});
}
function loadFromPagesBy(location){
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Pages",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='PublishingPageImage' /><FieldRef Name='Name' /><FieldRef Name='NameTitle' /><FieldRef Name='FeaturedItem' /><FieldRef Name='HRLocations' /></ViewFields>",
CAMLQuery: "<Query><Where><In><FieldRef Name='HRLocations' LookupId='TRUE'/><Values><Value Type='Integer>"+location+"</Value></Values></In></Where></Query>",
completefunc: renderStories,
CAMLRowLimit: 100
});
}
function renderStories(xData, Status) {
var itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
//alert(itemCount);
$('#container').empty(); //Clear
$(xData.responseXML).SPFilterNode("z:row").each(function() {
oneStory($(this));
});
}