learner
23rd May 2003, 13:05
I have copied one standard session & it's standard form also into my live vrc.
Now i would like to attach a session to the special menu in this session, so i went into Maintain Forms and then i clicked on Specific Options, & inserted an entry in that i.e. 56 user.8 Maintain Inspection related data, i then dumped ther form and was able to see this option in special menu of standard sesion, but now to my suprise when i created form specific option it doesn't ask for the session to be called when clicked on that option, i am enlosing herewith the screen shot of the form specific option .
How do i do this ??
If u see the screen shot, then i would like to associate one of my customized session to this form specific option user.8)
Regards
Learner
zardoz
23rd May 2003, 13:43
You have to write software to do this....
The users options are used in the script, there is nothing in the form that calls a session by using a specific option.
example:
choice.user.1:
on.choice:
| do something
choice.user.4:
on choice:
| do some other thing
grzegorz
23rd May 2003, 14:35
You can do that in following way:
- in Maintain Forms go to standard options and enable zoom (option 34) if disabled
- start form editor, click twice on choice field, switch on zoom to session and give session code; if your form does not have a choice field, add it.
- if you want to add more sessions, create menu containing them and use zoom to menu in choice button
- dump your form and you will see new option in Special menu without any extra source code.
learner
24th May 2003, 20:44
Dear grzegorz,
What u said that i can do it by using choice field and then define a menu/session which calls my session, but user.choice doesn't comes into picture, is it that i cannot call a session using user.choice.no ???
Waiting for your reply.
Regards
Learner
grzegorz
26th May 2003, 15:09
Ok, so let's go thru an example. Assume,that you want to modify a simple Maintain Countries (tcmcs0110m000) session, and you would like to put Maintain Areas (tcmcs0145m000) in Special menu. In standard version of tcmcs0110m000 menu Special is greyed out
So, repeat following steps:
- run Maintain Forms, locate form tcmcs0110m001 and copy to your current PVRC
- go to Standard Options and enable zoom (option 34)
- open the form in form editor, you will see something like VVVVVVVVV CC in bottom right corner of the form
- double click on CC letters, a new subsession starts (Maintain Form Choice Field)
- in field "Zoom" choose "Session"
- in field "Zoom to" put session code (tcmcs0145m000)
- save and exit, dump your form and run the session.
You should see, that "Special" menu is now available and Maintain Areas can be run from there. Is that, what you want? Note, that it has nothing to do with choice.user.n section in script, you do not need to change any source code.
PBforBaan
26th May 2003, 18:42
Hi Learner,
as u can see above, there are diffrent Methods to call subsessions.
May be u want to use a user defined Button to call your subsession, so u have to use the way u began - but u have to add a line in the choice.user.x - section of the script which uses the function zoom.to$().
If u would like to see the subsession in the specials-area u have to do the way like grzegorz. In this case u don't need to code anything.
learner
26th May 2003, 21:02
Yaah i agree the way u told that i click on this xx field on the form and take the option as Session and specify the respective session over there to be called, now my doubt is what if the special menu has 5 options ( 5 sessions to be shown in special menu ) rather than only 1 session to be called....in this case i am not able to enter 5 times the session by clicking xx option on form.... probably the idea now comes is use Menu in that case ...right .....!!!
anyway , I will try with this function zoom.to$()
grzegorz
27th May 2003, 08:38
Yes, right. In that case create a small one level menu with those five sessions. Menu will be attached to your Specials.
manusatsangi
7th August 2003, 09:39
Hi,
When attaching 5 sessions via the menu option from "Form Choice Field", how do I export and import variables between the calling session and called session?
Is it the same way as when we call from user defined choices...
In user defined schoice, I think export and import is normally done as follows:
choice.user.0:
on.choice:
export("x", x)
zoom.from.all:
on.entry:
import("x", x)
Regards
Manu
grzegorz
7th August 2003, 20:23
It works a little bit different.
In main program (calling session) you don't do anything, just declare your variable as extern. In subsession ( called one ) you can use
import( "var_name_in_main_prog" , local_var )
somewhere at start to obtain a value and
export( "var_name_in_main_prog" , local_var ) at the end to push a value back to the main program