function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jf317820jf317820 

error handling and empty queries

I'm running a number of queries, but when one of them returns a null data set, it's prematurely terminating my script...am i missing something here...how can i move on with my script after the error is handled?  thanks in advance.
cheenathcheenath
If you are making a sync call, you can catch the exception, something like:

try {
  sforce.connection.query(....);
}catch(error) {
  //something went worng but ignore it for now
}

If you are using a asycn style call, you can provide an error handler, something like:

var callback = {onSuccess: handleSuccess, onFailure: handleFailure};
sforce.connection.query("select ..", callback);

function handleFailure(error) {
  //ignore
}






jf317820jf317820
duh, sorry it's been long morning -- thanks for the help