Function GetSharePointList1() { context = SP.ClientContext.get_current(); oList = context.get_web().get_lists().getByTitle('SharePoint List 2'); var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml(query); items = oList.getItems(camlQuery); context.load(items);
Function GetSharePointList1() {
context = SP.ClientContext.get_current();
oList = context.get_web().get_lists().getByTitle('SharePoint List 2');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(query);
items = oList.getItems(camlQuery);
context.load(items);
context.executeQueryAsync(
Function.createDelegate(this, onSuccessSharePointList1),
Function.createDelegate(this, onFail)
);
}
function onSuccessSharePointList1() {
recNum = items.get_count();
if(recNum != 0){
var listItemEnumerator = items.getEnumerator();
while(listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
$().SPServices({
operation: "GetListItems",
async: false,
listName: "SharePoint List 2",
CAMLViewFields: "<ViewFields><FieldRef Name='Worklocation'/></ViewFields>",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + ReferenceID +
"</Value></Eq></Where></Query>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
Worklocation = ($(this).attr("ows_Worklocation"));
});
}
});
s = ..... (display all in table format)
$("#resultTable").append(s);
i++;
}
}