Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: GetListItems Returns "undefined" for a field

$
0
0
My code is as below, I want to call the below function from a different JS file and use the xdata further for looping in that file.

function GetSPListItemByQuery(ListName, Query, Viewfields) {
var URL = $().SPServices.SPGetCurrentSite() + "/TeamSite";
alert("URL" + URL);
$().SPServices({
    operation: 'GetListItems',
    webURL: URL,
    async: false,
    listName: ListName,
    CAMLQuery: Query,
    CAMLViewFields: Viewfields,
    completefunc: function (xData, Status) {
        alert("In GetSPListItemByQuery " + xData.responseXML);
        return xData;
    }
});
}

However, xData is a valid odject in this context but returns "Null" to the calling function. Please advice.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>