clientContext.executeQueryAsync(Function.createDelegate(this, function(){_returnParam = onQuerySucceeded();}), Function.createDelegate(this, this.onQueryFailed));
alert(_returnParam);
It's normal. executeQueryAsync
is asynchrone, so executeQueryAsync
is called (= an AJAX request is done), and immediately after, without waiting for the AJAX to be completed, you call alert(_returnParam)
with _returnParam that is still void.
You need to call another function at the end of onQuerySucceeded
if you want another action to be done.
By the way, I always thought that the Microsoft way is really difficult to use. I've created a library to deal with Sharepoint, if you are interested (it's called SharepointPlus). For what you want to achieve, the code would be something like that (I've also review your code with the array):
$SP().list("ISATestdata", "/sites/SIandT%20Project%20Intelligence").get({fields:"Name2,Type1,Plan,Analyse,Design,Build,Test,Run,SupportMaintenance,Link1,Link2",where:"Name2 = 'Something'"}, function(data) {
var listItemInfo = [];
for (var i=0, len=data.length; i<len; i++) {
listItemInfo[i] = [];
listItemInfo[i].push(data[i].getAttribute("Name2"));
listItemInfo[i].push(data[i].getAttribute("Type1"));
listItemInfo[i].push(data[i].getAttribute("Plan"));
listItemInfo[i].push(data[i].getAttribute("Analyse"));
listItemInfo[i].push(data[i].getAttribute("Design"));
listItemInfo[i].push(data[i].getAttribute("Build"));
listItemInfo[i].push(data[i].getAttribute("Test"));
listItemInfo[i].push(data[i].getAttribute("Run"));
listItemInfo[i].push(data[i].getAttribute("SupportMaintenance"));
listItemInfo[i].push(data[i].getAttribute("Link1"));
listItemInfo[i].push(data[i].getAttribute("Link2"));
}
alert(listItemInfo[0][0] + " " + listItemInfo[0][1] + " " +listItemInfo[0][2] + " " + listItemInfo[0][3] + " " +listItemInfo[0][4] + " " );
})