sanlii
19th May 2009, 13:24
Dear everyone
I meet a problem about some program develop by ourselves
it can run menual, but when I setup the program as JOB running
the program didn't work.:confused:
this program developed for print error report
and our client ask us set it as a job. and ouput the result to text file.
can anyone give me some hint.
best regard
george7a
19th May 2009, 13:30
Hi,
It really depends on the program you wrote (and the server). For example if you use client function like server2client/client2server, it might be problematic when ran from cron jobs.
What is your client's server (UNIX/Windows)?
Can you post the code of the program?
- George
Marioth
19th May 2009, 13:58
Hi Sanlii,
Please have a look in your job management and look if your job is set-up like this (see attachment). Be aware that the status of the job has to be "In queue". If this isn't working look under Unix if the jobserver is running.
Regards,
Mario
sanlii
19th May 2009, 14:09
I guess job didn't trigger the "print" button
if I add "form commands" to trigger "print" in the job
it works! :)
but actualy problem still exists. :(
my program behind
|****************************** declaration section ***************************
declaration:
table ttdhiv310
table ttdhiv311
table ttccom100
table ttcibd001
table ttcmcs023
table ttccom001
table ttdisa001
table ttdipu001
table ttdsls402
table ttdpur401
extern domain tcccp.yrno date.y
extern domain tcmcs.str12 econo.f, econo.t
extern domain tccom.bpid ofbp.f, ofbp.t
extern domain tcitem w.items
extern domain tcmcs.str9 w.itemp
extern domain tcmcs.str10 w.econo
extern domain tcdate crdt.f, crdt.t
extern domain tcdate trdt.f, trdt.t
extern domain tcmcs.str10 str_date
extern domain tcmcs.str35 f.page
|*************************** form sections *************************************
form.1:
init.form:
get.screen.defaults()
display.all()
|*************************** field sections ************************************
field.econo.f:
when.field.changes:
econo.t = econo.f
field.ofbp.f:
when.field.changes:
ofbp.t = ofbp.f
choice.cont.process:
before.choice:
execute(print.data)
choice.print.data:
on.choice:
if rprt_open() then
getdata()
rprt_close()
else
choice.again()
endif
|******************************************************************************
functions:
|function read.main.table()
function getdata()
{
Select tdhiv310.*,tdhiv311.*
from tdhiv310,tdhiv311
where tdhiv310._index1 inrange {:econo.f} and {:econo.t}
and tdhiv310.ofbp inrange {:ofbp.f} and {:ofbp.t}
and tdhiv310.crdt between :crdt.f and :crdt.t
and tdhiv311.econo= tdhiv310.econo
and tdhiv310.stus='40'
selectdo
w.econo = tdhiv311.econo(1;10)
Load_tccom100()
Load_tccom001()
Load_tdisa001()
Load_tcibd001()
w.itemp = tdhiv311.item(1;9)
w.items = tdhiv311.item(10;38)
Load_tdipu001()
Load_tdpur401()
f.page = tdhiv310.crep & tdhiv310.ofbp & w.econo
rprt_send()
endselect
}
function Load_tccom001()
{
select tccom001.nama
from tccom001
where tccom001._index1 = :tdhiv310.crep
selectdo
selectempty
tccom001.nama = ""
endselect
}
Server use HPUX and most of Clients are XP.
I think this program is quite sample...
thanks
Sam
Hitesh Shah
19th May 2009, 19:26
Program's in job normally execute the code in choice run.job or cont.process (in run.job absence) . So the code written in cont.process will get executed (in ur sample code) .
sanlii
20th May 2009, 06:24
finally I found the problem.
this program was use "Standard Commands" -> "Print Report" function button.
it didn't works (because of buttons position of form?)
and when I change another way to show "Print" Button by
Default Button
Command Type: Standard Command
Default Button: print.data
(and position of the button move to top 1)
run the JOB again, it Work!!! :D
to Hitesh Shah: Thank you, "choice.run.job" can works, but "cont.process" can't
anyway, Thanks
to Marioth: Thank you for sharing
to george7a: Thank you, you are so nice
Sam4327