You need to sign in to do that
Don't have an account?

Ajax 8.0 campaign query fails with "Array element at 0 is null."
I have an S-Control running a Campaign query that worked fine until recently. Now the campaign query throws the error "Array element at 0 is null" when I query a campaign that has members. The code is simple:
Has anyone else seen this problem and come up with a remedy?
function MemberIds(campaignID) {The handleQueryProblem function just pops an alert with the error:
this.count = 0;
var statusLine = document.getElementById("statusLine");
statusLine.innerHTML = "Getting Campaign members, please wait";
var MemberResultSet = sforce.connection.query("Select Id, ContactId, LeadId From CampaignMember where CampaignID = '"
+ campaignID + "'",
{onSuccess: handleMemberIdsQuery,
onFailure: handleQueryProblem,
source: {errorPrefix: "Campaign member query failed"
}
});
}
function handleQueryProblem(error, source) { alert(source.errorPrefix + " " + error); }It looks like the _invoke method in the API has lost an argument.
Has anyone else seen this problem and come up with a remedy?
Or is this error in handleMemberIdsQuery() method?
Thanks for checking out the query. I tried a simple test case and it works as well. I hope that someone from Salesforce can tell us what "Array element at 0 is null" means, so I can determine what to change in my S-Control to work around it.
_invoke and its first element is null. For query, the arg is just a string, so not
sure why you should be getting this.
BTW, have you extended String's prototype to add a push method to it?
Something like:
String.prototype.push = function() {}
The other lesson is that if you follow an asynchronous query with a synchronous call (such as my retrieve) that throws an error, and you don't catch the error, the onFailure handler from the asynchronous query will catch it.