noorulhaq
24th December 2005, 16:43
Hi All,
I am trying to run a job using AFS.
I am able to use the Session (ttaad5100m000) Maintain Job data.
I am assigning the value to the fields Next execution Date and Maximum Duration.I am able to save it, There is no problem in this.

After that when I activate the job using Activate the job (ttaad5203m000) from AFS, it is running but finally the staus of Job will be set to Runtime error. The task is also not completed.

But when I run it manually, I am not getting any error.
Can anyone pl give some suggession on this.

Your help is very much appriciated.
Thanks in Advance.

Francesco
26th December 2005, 20:41
Why run a job through AFS??? Hardly an ideal scheduling tool.
Does the job fail if you kick it off with say hmmm...a job daemon?

noorulhaq
27th December 2005, 09:04
Thanks a lot Francesco.

Ya we can run a job through scheduling tool.
But is it possible to run the automatically with a specified time interval without activating it. Because I wan to run a job without activating it in each time. Is it possible?

Thanks in Advance.

en@frrom
27th December 2005, 11:53
I think by changing and activating jobs there are some conflicts between AFS and standard Baan Tools. I have tried to run an afs session for global updating of job parameters (dates etc), and also had problems. Do you manage to actually change the parameters using afs, or you just try to run the job directly? Maybe you post your code, so we can have a better view on your problem...

noorulhaq
28th December 2005, 15:42
Thanks a lot..
The following is the sample code which I am using


Dim Retval As Short
' Maintain Job Data
oAFS.Session = "ttaad5100m000"
Dim Desc As String = "Sample"

oAFS.PutField("ttaad500.cjob", "RELOUT")
Retval = oAFS.FindRecord()
If (Retval = 1) Then
oAFS.PutField("ttaad500.peri", "1")
oAFS.PutField("ttaad500.peru", "1")
oAFS.PutField("ttaad500.desc", Desc)
oAFS.PutField("ttaad500.stim", "0")
oAFS.PutField("ttaad500.maxd", "0")
oAFS.PutField("ttaad500.jsta", "1")
End If

oAFS.UpdateRecord(True)
MsgBox(oAFS.ErrorMessage)

'Activate Job
oAFS.Session = "ttaad5203m000"
oAFS.PutField("ttaad500.cjob", "RELOUT")
Retval = oAFS.FindRecord()
If (Retval = 1) Then
oAFS.ContinueProcess("ttaad5203m000")
End If