|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
bkendzor
Joined: 10 Feb 2011 Posts: 22 Country: United States |
|
getJobProperties |
|
I have a javascript that greats text files for each script in the database.
It works fine until i=<a> .
I am trying to put a try catch around it because if there is no actual job for that i, I just want it to skip the error and go on to the next i.
However, no matter what I do when it executes Scheduler.getJobProperty(i,"NAME") on an i that doesn't exist, it fails. Shouldn't it just return null?
try {if(Scheduler.getJobProperty(i,"NAME") != null && !Scheduler.getJobProperty(i,"NAME").equals(""))
{output=Scheduler.getJobProperty(i,"ID")
}
catch(error) { output=""; scheduler.messageBox(error);
}
|
|
Wed Nov 02, 2011 1:15 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
I see several syntax errors in your code snippet below, there are mismatching { } brackets, invalid reference to exception message, case incorrect reference to Scheduler, and missing ; symbols. As for the testing for valid job id, getJobProperty for any property would generate a run-time exception if called for a non-existing job
Is the following what you want?
|
|
try
{
output = Scheduler.getJobProperty(i,"ID");
}
catch(error)
{
output = "";
Scheduler.messageBox(error.description);
} |
|
|
Wed Nov 02, 2011 1:48 pm |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|