You need to sign in to do that
Don't have an account?
pierre
AJAX async query calls success AND failure, error "invalid argument" number -2147024809
I'm doing a simple async query:
sforce.connection.query(str,{onSuccess : nearbysuccess, onFailure : nearbyfailure, timeout: 40000});
the query (str) works, I tested it with the sforce explorer.
AND results are returned, the success callback is called BUT 'nearbyfailure' is ALSO called !!!!
the error returned has the following Javascript attributes:
name: "Error"
number : -2147024809
description: "Invalid argument."
message: "Invalid argument."
What is going on?
sforce.connection.query(str,{onSuccess : nearbysuccess, onFailure : nearbyfailure, timeout: 40000});
the query (str) works, I tested it with the sforce explorer.
AND results are returned, the success callback is called BUT 'nearbyfailure' is ALSO called !!!!
the error returned has the following Javascript attributes:
name: "Error"
number : -2147024809
description: "Invalid argument."
message: "Invalid argument."
What is going on?
Here is one:
var result = sforce.connection.query("Select Name,Id from User", {
onSuccess : success,
onFailure : failure
});
function success(result) {
var records = result.getArray("records");
for (var i=0; i<records.length; i++) {
var record = records[i];
log(record.Name + " -- " + record.Id);
}
}
function failure(error) {
log("oops something went wrong " + error);
}
I know it works in most cases, I'm asking an explanation for the error I'm receiving.
will be that your onSuccess callback is throwing(causing) an error.
It's only the failure callback that gets an error as parameter
would the error be thrown from the success callback, and somehow caught in the failure callback?? that wouldn't make any sense.. and that doesn't explain the error meaning.
If you really want it, the whole code is at http://docs.google.com/View?docid=dh2cnqn_9cfx2n8fp .
and see if there is an error:
function nearbysuccess(aresult) {
try {
//your code here ...
} catch(someerror) {
alert("something went wrong " + someerror);
}
}
I'll troubleshoot a bit more and will post the solution to close this post. thanks again.
intervalid = setInterval(dorefresh(avariable),1000);
I switched to
intervalid = setInterval("dorefresh()",1000);
and it works now.