arrakis123
25th April 2007, 13:23
hi, im new in the forum and i like so much.
im doing some API, and i need help.
is a project which do some API(automatic sessions).
one of them, say that the session or object not found.
im ending manufacturing orders, and in the standard y see that:
"SWITCH.PROCCESS(PARENT)"
i dont know what it do this predefined var.
if anyone knows please, say
thanks
george7a
25th April 2007, 14:03
Hi,
"Parent" is a pre-defined variable that holds the process ID of the parent process.
In short, the switch.to.process function avoids the startup of the zoom process over and over again. You can read more about it in the Baan Manual. Go to Maintain Program Scripts (ttadv2130m000) and click on Manual. If you didn't find it, I can send it to you.
I hope it helps,
- George
mark_h
25th April 2007, 14:16
arrakis123 ,
Just a reminder - please only post a thread in one forum, no duplicate posting. So please make your best guess on the forum and the moderators can always move it to another forum.
Thanks and welcome to the board!
arrakis123
25th April 2007, 14:34
ok, thanks.
in the API that im doing, i have one error on the switch.to.proccess
(the session or object not found)
first, im doing one session that it have five or six API. on tisfc0202m000 (terminate manufacturing orders), i have the problem.
im debbuging that session and tisfc0208s000 and tisfc0507m000 for find the error causes. i see that in the tisfc0208s000, on line oh the switch.to.proccess make the error, and i dont know if i must to controle all the childs of the childs of the tisfc0202m000.
look at this:
function terminar.of()
{
stpapi.enum.answer("tisfc0202m000","tisfc01021",tcyesno.yes)
stpapi.enum.answer("tisfc0202m000","tisfc02023",tcyesno.yes)
stpapi.enum.answer("tisfc0202m000","tisfc02029",tcyesno.yes)
stpapi.put.field("tisfc0202m000","tisfc001.pdno",str$(tisfc001.pdno))
error1 = stpapi.find("tisfc0202m000")
if error1 <> 1 then
message("OF no encontrada en comunicar OF terminadas")
else
stpapi.put.field("tisfc0202m000","qdlv.frm",str$(tisfc001.qrdr))
stpapi.put.field("tisfc0202m000","comp.frm",str$(etol(tcyesno.yes)))
if isspace(error.msg) then
stpapi.handle.subproc("tisfc0202m000", "tisfc0507m000", "add")
stpapi.handle.subproc("tisfc0202m000", "tisfc0208s000", "add")
stpapi.continue.process("tisfc0202m000",error.msg)
stpapi.end.session("tisfc0208s000")
stpapi.end.session("tisfc0507m000")
endif
stpapi.end.session("tisfc0202m000")
endif
}
i put the stpapi.handle.subproc, but i dont know if i must to controle the other child of childs. i hope that my english not be too bad.
im sorry for the 2 posts.
thanks again
mark_h
25th April 2007, 20:08
Okay we now have it in the correct forum. I recommed searching this forum for tisfc0202m000 - here is one http://www.baanboard.com/baanboard/showthread.php?t=24296&highlight=tisfc0202m000 where I posted a copy of my code for this session. There are several other threads that may help. The only thing I can tell you is - sometimes I had to handle subsessions and sometimes I have not had to handle them. It varied over the years. Each SP seems like I run into something new. In your case you may have to handle all subsessions opened including tisfc0208s000. And then again you made need a stpapi library update or even a session update.
Paul P
26th April 2007, 04:19
Another code of mine that works for this session:
stpapi.put.field("tisfc0202m000","tisfc001.pdno",ProdOrderNum)
stpapi.find("tisfc0202m000")
stpapi.put.field("tisfc0202m000","qdlv.frm",NewQtyFinished)
if tisfc001.bfep=1 then
stpapi.enum.answer("tisfc0202m000","tisfc02023",str$(etol(tcyesno.no)))
else
stpapi.enum.answer("tisfc0202m000","tisfc02023",str$(etol(tcyesno.yes)))
endif
stpapi.enum.answer("tisfc0202m000","tisfc02029",str$(etol(tcyesno.yes)))
stpapi.continue.process("tisfc0202m000",TempStr)
stpapi.end.session("tisfc0202m000")
This code of mine doesn't set the production order status to Completed, however, since we expect the office staffs overseeing the production activity to do that. Notice also that I don't handle all kinds of backflush here since some kinds (I forget which kind) doesn't work well with API (at least in our condition where we stick with old service pack). Could you pls be specific which lines on your code hung?
Rgds,
Paul