g_Jericho
24th February 2003, 19:28
hi all,
How do we import the purchase order number and the position number from the purchase order lines session upon chossing the appropriate line.
what i m trying to achieve is that zoom to the purchase order lines session "tdpur4510s000", select the appropriate line and return the order number and the position number to my calling session (which is a new developed session).

Within forms, we can return only one value, how do i get both the values in my calling program.
i tried the following in my script, but its not working:
|zoom session****
zoom.from.tdpur4510s000:
on.exit:
import("tdpur041.orno",hold.orno)
import("tdpur041.pono",hold.pono)
Can someone help me out with this one

[QUOTE]
I do not have the source for the Purchase lines session, thus i cannot do any modifications there.

NPRao
24th February 2003, 20:06
Please use search options on the board for the already discussed topics -

Returning multiple values from zoom session (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=8394&highlight=zoom)

g_Jericho
25th February 2003, 11:41
I tried that, but nothing concrete has come out of it.
someone had posted that we cannot get the varaibles back to the calling session from the called session by writing the code in the calling session.
Is this the case, or can we get the variables back to the calling session

Jericho

zardoz
25th February 2003, 15:00
I think the error is in the section:

try use
zoom.from.tdpur4510s000:
on.entry:
import("tdpur041.orno",hold.orno)
import("tdpur041.pono",hold.pono)

on.entry: and not on.exit:
this one is executed only when the zoom session is exiting, not when enters.

g_Jericho
25th February 2003, 15:20
I still am not able to return the values.
do i have to remove the zoom from my form and also in case i m returning some values from my form????

ahulikavi
26th February 2003, 05:33
Dear J,

This code is part of the called session ( customised), its been called from a form field of another session by zooming ...

<<

zoom.from.tdpur045.dqua:
on.entry:
|get required values
import("tdpur045.dqua", t.pur45.dqua)
on.exit:
| export values to calling session
| notice I can directly update table fields .... and
| form fields ... therefore you need not have
|code of calling session

export("tdpur045.diqu", delivered.qty)
export("tdpur045.dqua",delivered.qty)
export("form.quan", delivered.qty )

>>

hope this helps

Akshay

g_Jericho
26th February 2003, 12:41
Hi
Is there any restriction in which sessions(Type of session) we can import the values more than one from the calling session.
I have tried a number of option, but none is working for me till now,
I tried the code by Akshay, but that is also not working, its not going to the zoom section at all...
The code i m using is something like this:

------------------------------------------------------------------------------------
declaration:

table ttdinv900 | Purchase Requisition
table ttiitm001 | Items
table ttdpur041 | Purchase Order Lines



extern domain tcitem item.f fixed
extern domain tcitem item.t fixed
extern domain tcorno p.orno.f
extern domain tcorno p.pono
extern domain tcorno orno
extern domain tcorno orno.t

extern domain tccotp zoom.cotp | zoom variable
extern domain tcsess zoom.progname | zoom variable
extern domain tcpono zoom.pono | zoom variable |#B4.0_b.n
extern domain tcorno zoom.orno | zoom variable |#10766-1.n
extern domain tcorno hold.orno
extern domain tcpono hold.pono
extern domain tcyesno hold.flag

|****************************** form section *****

form.1:
init.form:
get.screen.defaults()
|****Field Section*****
field.orno:
check.input:
select tdinv900.*
from tdinv900
where tdinv900._index1 = {:orno}
order by tdinv900._index1
as set with 1 rows
selectempty
input.again()
endselect

field.p.orno.f:
check.input:
select tdpur041.orno
from tdpur041
where tdpur041.orno = :p.orno.f
order by tdpur041.orno
as set with 1 rows
selectempty
input.again()
endselect

field.p.pono:
check.input:
select tdpur041.orno, tdpur041.pono
from tdpur041
where tdpur041._index1 = {:p.orno.f, :p.pono}
order by tdpur041._index1
as set with 1 rows
selectempty
input.again()
endselect
|*************** ZooM Section********************
zoom.from.p.orno.f:
on.entry:
|get required values
import("tdpur041.orno", hold.orno)
on.exit:
| export values to calling session
| notice I can directly update table fields .... and
| form fields ... therefore you need not have
|code of calling session

export("tdpur041.pono", hold.pono)





|***************** choice section **************
choice.cont.process:
on.choice:
read.main.table()


|*************** function section ****************

functions:

function read.main.table()
{
long count
hold.flag = tcyesno.no
db.retry.point()

select tdpur041.*, tdinv900.orno
from tdinv900 for update, tdpur041
where tdpur041._index1 = {:p.orno.f, :p.pono}
and tdinv900._index1 = {:orno}
and tdinv900.post = tcyesno.no
order by tdinv900._index1
with retry repeat last row
selectdo
if tdinv900.post = tcyesno.no then
tdinv900.post = tcyesno.yes
endif
tdinv900.prno = p.orno.f
tdinv900.pono = p.pono
db.update(ttdinv900, db.retry)
commit.transaction()
hold.flag = tcyesno.yes
endselect
commit.transaction()
if hold.flag = tcyesno.yes then
mess("tdunis9201.c", 1)
else
mess("tdunis9201.1c", 1)
endif
}
|****************End of source

what i m trying to do is zoom to the purchase order lines and upon selection of a line, i want to return the purchase order number as well as the position number.

Can someone help me as to where am i going wrong????

g_Jericho
4th March 2003, 13:35
I tried a number of options which were posted over here and want to thanx all of u guys.
But i guess, its not possible to import multiple values by writing the code in the calling script only.
To do so, one has to write the following in the called script also:
zoom.from.all:
on.exit:
if marked then
export("tdpur041.pono", tdpur041.pono)
endif

and in the calling program, then there is no need to even import the variables.

Jericho

g_Jericho
4th March 2003, 13:36
I tried a number of options which were posted over here and want to thanx all of u guys.
But i guess, its not possible to import multiple values by writing the code in the calling script only.
To do so, one has to write the following in the called script also:
zoom.from.all:
on.exit:
if marked then
export("tdpur041.pono", tdpur041.pono)
endif

and in the calling program, then there is no need to even import the variables.

Jericho


But i was looking at some option, where one doesn't have the access to the calling program, then what happens, can we have the same functionality there or the user has to enter the data twice by zooming to the same session and same record.