SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
getJobProperties

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
getJobProperties
Author Message
bkendzor



Joined: 10 Feb 2011
Posts: 22
Country: United States

Post getJobProperties Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
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?

Code:
try
{
     output = Scheduler.getJobProperty(i,"ID");
}
catch(error)
{
     output = "";
     Scheduler.messageBox(error.description);
}

Wed Nov 02, 2011 1:48 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.