 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
Job Definition When Using COM Object CreateJob Method |
|
We currently create dynamic jobs using the CreateJob method. We currently set the Job definition using these properties:
NAME, JOB_TYPE, DETACHED, SCHEDULE_TYPE, ASYNC, START_DATE, and START_TIME. All of these get set correctly and each dynamic job behaves accordingly.
We also have jobs within 24x7 that send emails on errors, and this works okay, too.
Now, we're trying to add properties to our dynamic jobs' definitions to have them send emails on errors. Here's the additional job defintion properties that we're attempting to use:
MSG_ACTIONS = EE
MSG_ACCOUNT = the same email that we successfully use for our other jobs
MSG_PASSWORD = the same password that we successfully use for our other jobs
MSG_RECIPIENT = the same email that we successfully use for our other jobs
Am I doing something incorrectly? Also, is it relevant whether or not the job is disabled on error?
|
|
Thu Jun 19, 2008 12:16 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I think you are very close. In addition to that you should set MSG_EMAIL to Y
|
|
Thu Jun 19, 2008 10:58 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
I tried using that, and I also tried using MSG_E-MAIL, which the documentation has, and neither of those additions worked. There was a behavior change, though. With the code that I originally posted, the jobs correctly indicated in their properties (the box is checked) that they should send an email on an error even though they dont actually seem to send it. When I added the suggested code, the box became unchecked for new jobs. So, I tried something the following:
I remove MSG_ACTIONS = EE, and replaced it with MSG_ERROR = Y and MSG_E-MAIL = Y, but this resulted in the box being unchecked. I tried combinations of these three fields and nothing was successful.
|
|
Fri Jun 20, 2008 10:19 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I'm pretty sure you need all 3
MSG_ERROR = Y,
MSG_EMAIL = Y
and MSG_ACTIONS = EE
However the order in which you specify these properties might be important.
Here is a sample script creating new job with email-on-error options set
 |
 |
// Create new job object
Dim job_id, number
JobCreate( job_id )
JobModify( job_id, "NAME", "Dynamic job created from script" )
JobModify( job_id, "JOB_TYPE", "P" )
JobModify( job_id, "SCHEDULE_TYPE", "O" )
JobModify( job_id, "START_DATE", "1999-01-10" )
JobModify( job_id, "START_TIME", "10:00" )
JobModify( job_id, "COMMAND", "notepad.exe" )
JobModify( job_id, "MSG_ERROR", "Y" )
JobModify( job_id, "MSG_EMAIL", "Y" )
JobModify( job_id, "MSG_ACCOUNT", "test@test.com" )
JobModify( job_id, "MSG_RECIPIENT", "test@test.com" )
JobModify( job_id, "MSG_ACTIONS", "EE" )
// Enable new job
JobEnable( job_id, TRUE ) |
|
|
Fri Jun 20, 2008 11:36 am |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
Thank you. Once I changed it to the order that you had it in your example, it worked.
|
|
Fri Jun 20, 2008 11:46 am |
|
 |
|
|
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
|
|
|