I have now updated to use sentence case consistently for the spHostUrl and webURL variables, plus the subsite name (LCM).
My updated code is not longer giving the not found, but instead "302 found" and does not return any results or other errors :(
My updated code is not longer giving the not found, but instead "302 found" and does not return any results or other errors :(
var context;
var web;
var spHostUrl;
var parentContext;
$(document).ready(function () {
var spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
context = new SP.ClientContext.get_current();
parentContext = new SP.AppContextSite(context, spHostUrl);
web = parentContext.get_web();
jQuery.support.cors = true;
$().SPServices({
operation: "GetListItems",
async: false,
webURL: spHostUrl + '/LCM',
listName: "Brisbane Inbox",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Debtor_x0020_Code' /><FieldRef Name='Patient_x0020_Exit_x0020_Date' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
var liHtml = liHtml + "<li>" + $(this).attr("ows_Debtor_x0020_Code") + "</li>";
var liHtml = liHtml + "<li>" + $(this).attr("ows_Patient_x0020_Exit_x0020_Date") + "</li>";
$("#tasksUL").append(liHtml);
});
}
});
});
function getQueryStringParameter(urlParameterKey) {
var params = document.URL.split('?')[1].split('&');
var strParams = '';
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split('=');
if (singleParam[0] == urlParameterKey)
return decodeURIComponent(singleParam[1]);
}
}