pjohns
14th January 2003, 18:35
I've a session that I can run manually but when I try to run the same session via a Baan job it will not work.

When I execute the Baan job via the Activate Job session - ttaad5203m000, Baan goes through the motion of opening and running the session and returns a 'Job Ran Successfully' message but there is no output.

The session is customised, should this make any difference? I should also point out that I have the same issue with the same session on our pre-production server.

I have deleted and re-created the job, sent the output to different devices but still nothing.

I can run another session via the same job with no problems.

I have attached the session script in case anybody can spot something obvious.

Any other ideas?

Many thanks

PJ

dnnslbrwn
14th January 2003, 18:51
Why are you setting the initial form field values in the init.form after calling get.screen.defaults()? Maybe if you set the defaults in the form instead, it might work? Don't see why it would make a difference but that is the only thing that I would have done differently.

Cheers,

-Dennis

gfasbender
14th January 2003, 19:20
Try setting pono.t = 999

NPRao
14th January 2003, 21:33
You can recode the init.form section as -


if not (api.mode or job.process or background) then
get.screen.defaults()
endif

pjohns
15th January 2003, 11:55
Thanks for your replies.....

Dennis: This session has been written by a colleague in Japan. The orno and pono defaults are set in the script as they are not available for the user to set on the form.

Gfasbender: I did try to change the pono.t to 999 but I did not get any data returned as I presuming that this will only include a small sub-set of orders to be scanned by the session.

NPRao: I re-coded the init.form section as per your suggestion but this did not make any difference when running the session through a Baan Job.

Thanks for the suggestions, if you have any more then I'm all ears!!

Cheers

PJ

nick_rogers
15th January 2003, 19:35
Sometimes when printing to the "D" the output gets lost (never shows up). Maybe this is happening. but with other devices. Use the session Display Device Que (ttaad2530m000) to see if the report is actully generated.

I am sure that you have already run the session in interactive mode with the same form data and confirmed a report is created ?? :)

pjohns
15th January 2003, 19:55
Hello Nick,

Yep I've ran the session in interactive mode passing the same form data and it all works okay.

I checked the Display Device Queue session as suggested and there is a slight difference between the two executions of the session. I am sending the output to 'ASCIF' - rewrite file.

When running the session interactively the status equals 'Done' but when running the same session/form data via the job the status is 'Removed'. Does this give any clues??

Thanks

PJ

nick_rogers
15th January 2003, 20:03
the removed status means the report was printed and then its tmp file was deleted. The status done means the report was printed and the tmp file was retained so that the report can be re-printed or displayed via the maintain device queue session. This all relates to the delete delay time on form 4 of the user setup.
Are you running the job with a different user login verses the login when running interactively ?
if so maybe this is a clue.

kammie
17th January 2003, 13:45
During job process, no form becomes current, so no form subsections (init.form, before.form, after.form) are executed.

I suggest the following:


|****************************** program section

before.program:
if job.process then
orno.f = 1
orno.t = 999999
pono.f = 1
pono.t = 9999
endif

|****************************** form section

form.1:
init.form:
get.screen.defaults()
|+++
|- orno.f = 1
|- orno.t = 999999
|- pono.f = 1
|- pono.t = 9999

pjohns
17th January 2003, 14:10
Thanks Kammie,

The session now works perfectly!

This is one to remember for the future.

I'll definitely have a good weekend now!!

Thanks again.

Regards

Philip