timb25
28th March 2012, 22:22
What I want to do is be able to start from a list session and then zoom to another session that will open with a predetermined record.
So we will start from purchase receipt lines (tfacp2544m000). I added a custom sesssion (form command) on that session that is under the SPECIFIC menu.
This is a customized session the exports the order and position number to be used to find the record in the 'zoom to' session. Here is the code that is in the custom session:
before.program:
import("tfacp245.orno",orno.t)
import("tfacp245.pono",pono.t)
import("tfacp245.loco",loco.t)
switch.to.company(loco.t)
tdpur401.orno = orno.t
tdpur401.pono = pono.t
zoom.to$("tdpur4101m000", z.session, "", "", 0)
So, i am importing the variables from the first session.. switching to the company that contains the po information. Setting the key fields in the 'zoom to' session and then finally zooming to the po lines session....hoping it will open with the correct record.
However, when the tdpur4101m000 session opens, the current record is the first record.
I have verified the record that I am expecting is there, and it is.
Is this even possible to accomplish (without source code)?
Thanks,
-Tim
dmcnally
28th March 2012, 23:00
Tim,
You might try putting your code in the
zoom.from.all: or zoom.from.<zoomname>:
on.zoom:
and then issue an execute(find.data)
Dave M.
mark_h
29th March 2012, 15:32
Dave is correct and that code should go in the tdpur4101m000 session script. You might need to check what that script is doing to get the current record.
timb25
29th March 2012, 16:11
Thanks Dave and Mark for your replies, but there is a problem. We don't have the source code for tdpur4101m000 where i can put in the zoom.from piece. The code from my original post is from a 'middle' session that i was hoping to link the two standard sessions together. Maybe I can create a copy of the standard tdpur4101 and then put the zoom.from code in this part.
mark_h
29th March 2012, 16:13
You can try changing the start parameter on tdpur4101m000 - maybe from get defaults to find data. Assuming LN uses this type feature also. Not sure if that would work or not.
Juergen
30th March 2012, 09:35
Hi Tim,
please try to use the variable xi.purchase.order, that should do the trick.
Before calling tdpur4101m000 this variable must be set to the order you are searching for.
extern domain tcorno xi.purchase.order
......
......
xi.purchase.order = orno.t
zoom.to$("tdpur4101m000", z.session, "", "", 0)
Regards,
Juergen
timb25
30th March 2012, 20:49
Thanks alot Juergen!! That worked.
Could you please tell me about or point me into a direction that explains what the "xi" is all about? I'm assuming this is something new with LN??
timb25
3rd April 2012, 20:50
I'm trying to perform this same 'zoom to' functionality with another session (tfgld1101m000). I was running into the same problem. Hopefully, there is a way to open the session with the record that was picked from the calling session.
andreas.toepper
4th April 2012, 09:50
Could you please tell me about or point me into a direction that explains what the "xi" is all about? I'm assuming this is something new with LN?
Well, it's just another bunch of variables used for importing at sessionstartup.
I'm doing some customisation on LN right now and it seems Infor has still no naming-convention for variables used for passing initvalues. Some session will use zoom.orno, some will use the keyfields of their maintable, some the keyfields of the parents maintable. Using xi.purchase.order or xi.sales.order ist just another possibilty used in sessions.
Some session use all the above variants, i.e. tdsls4101:
function void handle.importing.fields()
(..)
if isspace(g.imported.sales.order) then
import("zoom.orno",g.imported.sales.order)
import("zoom.pono",g.imported.sales.order.position)
endif
if isspace(g.imported.sales.order) then
import("xi.sales.order",
g.imported.sales.order)
import("xi.sales.order.position",
g.imported.sales.order.position)
import("xi.sales.order.sequence",
g.imported.sales.order.sequence)
import("xi.sold.to.bp", g.imported.sold.to.bp)
endif
if isspace(g.imported.sales.order) then
import("tdsls401.orno",g.imported.sales.order)
import("tdsls401.pono",g.imported.sales.order.position)
endif
if isspace(g.imported.sales.order) then
import("tdsls400.orno",g.imported.sales.order)
endif
I usualy started testing with the zoom-session's maintable, then zoom.xxxx instead. If both ways won't work you'll need to look into the zoom-session's script.
Our FP6 version of tfgld1101 imports like this:
function void handle.importing.fields()
{
|# import("fieldX", g.imported.fieldX)
|# import("xi.orno", g.imported.orno)
|# import("xi.bpid", g.imported.bpid)
|# xi = e(x)ternal (i)nput
import("prog.name$", g.imported.parent.session)
if not isspace(g.imported.parent.session) then
import("tfgld103.year", g.imported.year)
import("tfgld103.btno", g.imported.batch)
endif
}
Is this the primarykey of the parents maintable?
joepte
25th April 2012, 19:11
Hi,
I am triyng to zoom.to from one custom session to another and get the item and lot to connect and if put the find.data in the zoom.from.all section it doesn't work because the zoom.from.all. My code is much ad Dave suggests but the zoom.from.all doesn't get activated. If I put the find.data in the before. program I get a null pointer error.
these are multi occ forms does that prevent me for going into zoom.from.all?
I do see the values in the called session.
Thanks for any insights...
called session.
zoom.from.all:
on.entry:
execute(find.data)
calling session.
choice.user.3:
on.choice:
export("zoom.item", zoom.item)
export("zoom.clot", zoom.clot)
zoom.to$("tdltcc999m000",z.session,"","",0)
BaanInOhio
25th April 2012, 20:01
There a few ways to accomplish passing variables to standard sessions where you don't have source. In 4c, 5c, or LN you can often guess what is being imported by printing object detail for the script and searching through the extern variables. Not an exact science but you can often find the extern variable by domain by searching in the display. Find a standard session that calls the one that you want to zoom to and run "ttstpobjinfo" for the component type = script and unclick all boxes but 'show symboltable'. All external variables are listed, including those sent to the zoom sessions where main table links are not used.
If running LN, you can force the query for some zoom sessions by calling 'query.extend.where.in.zoom()'. The lone argument is the addition to the standard 'where' clause - like the 4c 'query.extension' variable. When calling this session, you typically convert the variables in the argument instead of sending a variable name to the query. Therefore, if you are looking for a specific order number, you would call it like:
query.extend.where.in.zoom("tdsls401.orno = " & quoted.string(tdsls401.orno))
The 'quoted.string' call puts the required double quotes around string variables. Otherwise, you can add numeric variables without the quotes:
query.extend.where.in.zoom("tdsls402._index1 = " & quoted.string(tdsls401.orno) & "," & str$(tdsls401.pono))
You must call "clear.query.extend.in.zoom()" after the zoom to ensure that other zooms to not inherit the old variables.
joepte
25th April 2012, 23:21
It looks like I messed up and didn't include the zoomname of the calling process thus the zoom.from didn't execute - what do they say... RTFM, ok next time.
Thanks for the response Ohio, I shall keep that as a good reference.
"zoomname
The name of the calling process. This is used in the zoom.from sections in the called process. If no name is provided here, zoom.from sections in the child session are not executed.