outra9e
24th February 2003, 13:18
Hi everyone

I have created a button which when clicked, opens a session and trys to find a relevant record.

What I want the button to do is open the session so that a new record is to be inserted and passes over two field values to the corresponding fields on the session just opened.

Here is my current scripting....

choice.user.0:
on.choice:
zoom.trno = tssma906.trno
export("zoom.trno", zoom.trno)

zoom.to$("tssma9135m000", z.session, "tssma9135m000", "", 0)

Any ideas anyone?

Cheers

evesely
24th February 2003, 15:53
The functions export() and import() work only to/from the parent process. So, in this case, you would want to put import in your child session (and skip the export piece in this session). So, in your tssma9135m000 session you could do something like:

form.1:
init.form:
if background then
import("zoom.trno", zoom.trno)
endif

You could also put this in some other section in the child process. Remember to declare the variables as externs in both the parent and child processes.

outra9e
26th February 2003, 16:09
Ed

I have taken you advice and the script on the "child" session compiles with no complaints, however it is not doing the trick. Initially I had the "child" session's start option to be find and so I changed this to be insert, but this hasn't helped either.

Can you think of any reason why it is not passing the value over?

Cheers m8y

zardoz
26th February 2003, 18:04
Try using this:
In the calling session,

choice.user.0:
on.choice:
zoom.trno = tssma906.trno
export("zoom.trno", zoom.trno)

zoom.to$("tssma9135m000", z.session, "NAMEOFCALLING SESSION", "", 0)
------------------------------------------------------------------------------------
in the session tssma9135m000:
.................
zoom.from.NAMEOFCALLINGSESSION:
on.entry:
import("zoom.trno", zoom.trno)
.................
field.????.trno:
before.input:
????.trno = zoom.trno
..................

Note: it's better for the called session to duplicate it in tdsls9135s000 because isn't a main session. You can of course use the same script and the same forms. In this new session the starting option can be different, as add.set by example.

evesely
26th February 2003, 19:01
Andy,

Did you try running the subsession in debug mode to make sure the import was called? I assume that you declared the appropriate variables as externs in both sessions, right?

outra9e
7th March 2003, 15:39
It is called, it just does not push a value across - here is the current code....

I am using the "Export" expression on the parent session and also this code in the form section on the child session...


form.all:
init.form:

zoom.from.tssma9106m000:
on.entry:
import("zoom.trid", zoom.trno)

Cheers

evesely
7th March 2003, 15:56
Is the variable in the parent session zoom.trid or zoom.trno? Based on the previous posts, I think you have the variables backwards. Your code takes the parent variable zoom.trid and puts it into the zoom.trno variable in the child. If you want it the other way around, code it like:

import("zoom.trno", zoom.trid)


Also, you shouldn't need the export command in the parent. Based on you code, your parent should have a zoom command with "tssma9106m000" as the third argument.

Good luck:)

outra9e
10th March 2003, 11:46
Ed my good fellow!

Sopt on m8, have switched them over and its fine, Thanks a lot :)

Cheers