suribaan
17th November 2004, 18:45
When I use function server to insert a record in Supplier master tccom020, session tccom7250s000 starts up when there exists more than one geo code. When running the session manually, we can select the appropriate geo code from the popup session and the supplier table gets updated with the select geo code. But when we call via funtion server, how do we handle this. Even when put the value for this geo code field, the insert dont work. The child session keeps hanging there until we kill and the supplier data will not be inserted. Any solution?

stpapi.handle.subproc("tccom2101m000","tccom7250s000","add")
stpapi.get.field("tccom7250s000", "tccom750.geoc", h.geoc)
stpapi.handle.subproc("tccom2101m000", "tccom7250s000", "kill")
stpapi.end.session("tccom7250s000", err)
stpapi.put.field("tccom2101m000", "tccom020.geoc.l", h.geoc)

ret = stpapi.insert("tccom2101m000", 1,err)

I use Baan 4c4.

Thanks
suresh

mark_h
17th November 2004, 20:33
I would expect you could do one of two things - not sure which works since I am not familiar with the sub-session. Here they are:


stpapi.handle.subproc("tccom2101m000","tccom7250s000","kill")
stpapi.put.field("tccom2101m000", "tccom020.geoc.l", h.geoc)
ret = stpapi.insert("tccom2101m000", 1,err)


Or maybe something like this:

stpapi.handle.subproc("tccom2101m000","tccom7250s000","add")
ret = stpapi.insert("tccom2101m000", 1,err)
stpapi.put.field("tccom7250s000", "tccom750.geoc", h.geoc)
stpapi.find("tccom7250s000",err)
stpapi.continue.process("tccom7250s000",msg)
stpapi.end.session("tccom7250s000", err)
stpapi.save("tccom2101m000", 1,err)


Of course this just depends on how the session reacts and at what point the sub-session is started. In the first example the sub-session should not start. In the second I am just doing a find in the sub-session (guessing on this part), then a continue and end. The continue may or may not automatically close the session and you may have to do it manually. Usually you just have to play with something like this until you get the sequence and control down pat. If I was you I would try the first method, but sometimes it does not keep the session from coming up. I am assuming the sub-session comes up on the insert into tccom2101m000, which may be wrong.


Mark

suribaan
18th November 2004, 22:43
Mark,

The first method did not work, however second way works fine. Thanks
a lot. Guess the way the dll is called in the session.

-suresh

mark_h
18th November 2004, 23:53
One of the many things that make these API function servers challenging. This session may not work with the kill option, but it might work in another.

Mark