spartacus
4th December 2008, 10:53
we have got a strange behavior with the import from a field-variable wich is executed in a zoom.from.all-section (we are on ERP5c).

- we use "start.session()" to start the child modeless
- in the child wie do in a zoom.from.all something like:
import("abpur204.rqno",zoom.var)

1. I think that works for some days without problem
2. Debugging the code I found that it works somtimes, but sometimes there is a "ZZZZZZ" fild into "zoom.var", while in the calling process abpur204.rqno in the parent contains the right value, just a number (but the domain is a string). Without debugger it seems to work not at all. With "message()" I checked, that there is always a "ZZZZZZ" filled in.
2. Using in the calling process an other external variable like:
myvar = abpur204.rqno
start.session(...)

it works!!!!

3. Execute the import in "before.program" it works also with abpur204.rqno


I never noticed that there is a problem with the import of field-variables in "zoom.from.all" till now. I think there has to be an other problem???

spartacus
4th December 2008, 12:44
Just found somthing like a solution: If I start the child process MODAL it works! Anyway strange, I never noticed that before, but for the moment it is good enaugh.

zardoz
4th December 2008, 16:16
I've found something similar on BaanLN.
But I think the explanation could be simple: if the child process is started in MODAL mode, the main process waits until the child process is ended, otherwise the control is returned to the main process before the called process could set the variable. Using the debug, you wait (in the main process) till the called program set the variable, so it seems to work...

ARijke
4th December 2008, 17:30
Import works on the parent process. With starting a session Modal it has the first session as its parent process. In case on modeless the processes are independent. So the import will not work.

spartacus
5th December 2008, 14:37
Import works on the parent process. With starting a session Modal it has the first session as its parent process. In case on modeless the processes are independent. So the import will not work.

I think you can't say that so easy.
1. Baan itself imports in a MODELESS started sessions. See as an example: cprrp0520m000 starts modeless cprrp0521s000. The import is done in a "zoom.from.all"-section
2. Why does ist work in a before.program - section (at least it looks so)

Sorry, I think it has to be a little more complicate ;-)

zardoz
5th December 2008, 15:42
mhm... I think Spartacus is right, there must be another explanation.