cherokee
16th November 2010, 22:00
Hello everyone,
I do not know what I am doing wrong but, the import/export funcitons are not passing any values. I'll appreciate any help.
***************************
|main multi-occ session.
extern domain tcorno so
extern domain tcpono soli
choice.user.2:
before.choice:
if mark.delete then
zoom.to$("tdsls9189m000",z.session,"tdpurc111m000","",0)
import("so",tdpur987.so)
import("soli",tdpur987.soli)
endif
|*************************************
|zoomed multi-occ session tdsls9189m000
extern domain tcorno so
extern domain tcpono soli
zoom.from.all:
on.exit:
if mark.delete then
export("so",tdsls989.orno)
export("soli",tdsls989.pono)
endif
Thanks in advance...
mark_h
16th November 2010, 23:48
I have had problems in the past with table fields using export and import. So I usually do something like this:
zoom.rfq = tdexi001.rfqnum
export("zoom.rfq",zoom.rfq)
dummy = zoom.to$("tdexi0551m000",z.session,"tdexi0109","",0)
In zoomed to session.
zoom.from.all:
on.entry:
import("zoom.rfq",zoom.rfq)
tdexi051.rfqnum = zoom.rfq
execute(find.data)
I don't recall why I started doing this, but now I just do this as second nature.
shah_bs
17th November 2010, 04:09
table definitions are always 'extern', so table fields can be directly imported, the table having been declared in both the calling script as well as the called script.
example:
import("tdinv001.item", tdinv001.item)
Of course, the assumption is that the logic of the calling session has read the record of tdinv001 before the zoom to the called session.
rp.chowdary
17th November 2010, 09:25
Hello everyone,
I do not know what I am doing wrong but, the import/export funcitons are not passing any values. I'll appreciate any help.
***************************
|main multi-occ session.
extern domain tcorno so
extern domain tcpono soli
choice.user.2:
before.choice:
if mark.delete then
zoom.to$("tdsls9189m000",z.session,"tdpurc111m000","",0)
import("so",tdpur987.so)
import("soli",tdpur987.soli)
endif
|*************************************
|zoomed multi-occ session tdsls9189m000
extern domain tcorno so
extern domain tcpono soli
zoom.from.all:
on.exit:
if mark.delete then
export("tdsls989.orno",so)
export("tdsls989.pono",soli)
endif
Thanks in advance...
Try this it may help.
BaanInOhio
17th November 2010, 18:15
I always try to perform all interprocess communications in the called (child) sub-session. The only exception is for setting main table fields (in the child)that are automatically exported during the zoom. Any EXTERN variable (including table fields) in the parent session can be imported in to the sub-session using:
before.program:
-or-
zoom.from. ---
on.entry:
import("variable.in.parent", variable.in.child)
The "variable.in.parent" must be EXTERN in the parent session or a table field (extern by default). The variable.in.child does not have to be extern.
Sending updated variables from the child to the parent are done in the child sub-session as well, using:
export("variable.in.parent", variable.in.child)
A conversion (if possible) from parent to child or child to parent is done during the interprocess communication (typically between string and numeric). I don't like using an "import" in the parent following return of the zoom since the child is no longer active at that point.
I always try to limit my interprocess communication to when both parent and child are active, so an 'export' from parent before the child has started can have unpredictable results. A long as a variable is extern in the parent, the child can acquire the variables at any time in the sub-session and change the variables in the parent before leaving the session.
cherokee
17th November 2010, 18:31
I declared the main table of the child session on the parent session and then on the child session export its values, no need to import on the parent table after coming back from zoomng (it is working now).
zoom.from.all:
on.exit:
if marked then
export("tdsls989.orno",tdsls989.orno)
export("tdsls989.pono",tdsls989.pono)
endif
Now I'm running in a different problem within the same sessions. I am working with two multi-occ session. When I select on the parent session a row , I zoom to the child, pick my record when and I come back to the parent session, on the after choice section, I do do.occ(actual.occ, update.values), gives me this message "Record modified by other user; new values are displayed" !! :mad:
I do not know if I should open a different thread... :confused:
BaanInOhio
17th November 2010, 19:57
Unless I don't understand the issue, I believe that the problem is the use of DO.OCC after coming from the child session, since it tries to lock the record that you already marked and changed in the child session.
I would try the DO.OCC.WITHOUT.UPDATE instead, which doesn't try to lock the selected record before calling the function. Within the function, you might want to call UPDATE.OCC() to let the session know that some variables were changed in the sub-session without modifying a form field.
cherokee
17th November 2010, 20:56
Thanks... the message is gone and I can see the values on the screen now but, it doesn't kept the values in the DB. once I go out of the session and come back, no values are there... I also tried as you suggested to put the update.occ() within the update.sls.order function, same result. In addition, I also tried execute(update.db) with no better luck.
choice.user.2:
before.choice:
if marked then
tdpur987.item = hold.item
zoom.to$("tdsls9589m000",z.session,"tdpurc111m000","",0)
do.occ.without.update(actual.occ,update.sls.order)
endif
after.choice:
| execute(update.db)
update.occ()
mark_h
17th November 2010, 21:14
I wondering if - as soon as you returned you did an execute(update.db) to stop the current transaction and then follow it with do.occ or update.occ. Not sure I did this anywhere.
cherokee
17th November 2010, 21:26
As soon I come back to the parent session with the values I need form the child, I do the do.occ.without.updte(actual.occ,update.sls.order), I can see that the values on the screen are there as I wanted but, still have to save them so, is then when I do the update.occ() or execute(update.db) but the values are not saved.
the do.occ.without.update, it saves and unlocks the occurance before it goes to perform the function is told to do. So the DB has the old values, when the do.occ.without.update is performed is only at the memory level, not at the DB level so, I thought that update.occ() will force that or execute(update.db) but seems that I have to lock the record again and then re-update. I've tried several ways with no success. :confused:
cherokee
17th November 2010, 22:31
Solved... I do not know if it is the best way but it works and kind of make sense.
I put the zoom.to$ within the do.occ... so, record is locked and I can update any field on the parent with values coming from the zoom session...
choice.user.2:
before.choice:
if marked then
do.occ(actual.occ,update.sls.order)
endif
function update.sls.order()
{
tdpur987.item = hold.item
zoom.to$("tdsls9589m000",z.session,"tdpurc111m000","",0)
tdpur987.so = tdsls989.orno
tdpur987.soli = tdsls989.pono
}
Thank you for your help.
aamir_faried
10th September 2011, 07:29
I got same problem and I figure it out that it works by using same name for export variable and variable Ref.
For example
if this is not working like this export("so",tdsls989.orno)
then try this export("tdsls989.orno",tdsls989.orno)
or
so = tdsls989.orno
export("so",so)
In short, the point is to use samename for both parameter no matter its table field or variable.
/Aamir
Marius Titulesc
18th December 2018, 13:08
It works if you use the same name regardless of variable.
Thanks for the tips!
__________________________________________________________
Marius form Import Courses (https://w2c.ca/en/training/customized-customs-coaching/)