nidyar
11th December 2006, 13:22
How in BaaN Tools, can I prompt the user, allowing him to provide the value of a variable?
Requirement of the above started like this:
I have a standard print session to which I have attached a customized report. Now I need to get value for a variable from user but i don't want to modify the standard session form also. Only option is to get the value from the user in runtime. Is it possible?

baancust
11th December 2006, 13:43
U can always do that .
U can ask him a question with yes / no .
If the answer is yes then , you can start a new session where in he can insert the number he wants .
I hope this will solve ur problem .

george7a
11th December 2006, 14:19
Hi,

If I understood your problem I think you can do it with out editing the main session. Here is how you can do it:

1. Create a new session that will have only the three variables that you want your user to enter. let it export (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_interprocess_transfer_export) these variables when it ends
2. In you report script put the following code in before program section. It will call your customized session and import (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_interprocess_transfer_import) your wanted variables:

declaration:
extern domain tcmcs.str100 my.var1,my.var2,my.var3

before.program:

zoom.to$("tccom2mysess", Z.SESSION, "", "", 0) | tccom2mysess is your new session you developed in (1)
import("my.var1",my.var1)
import("my.var2",my.var2)
import("my.var3",my.var3)

I hope it helps,

- George

nidyar
11th December 2006, 15:30
Thanx George, Thanx Baancust....
George, since you were more closer,
But the report doesn't wait for me to enter the new values in the zoomed session. It very much opens the new session but report completes before even i start entering the new values. Also can this new session be a multi occurence sessions from which i can select the relevent record (of course if the above problem is solved).

george7a
11th December 2006, 15:33
Hi,

You will have to use start.session() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_starting_and_stopping_programs_start_session) instead. It waits in 5.0 c (zoom.to$ waits in baan IV)

Example:
start.session(MODAL, "tccom2mysess", "", "")
- George

nidyar
11th December 2006, 15:51
Perfect Geroge. Hats Off...

Also I have another standard session (Customer master) from which user will now be selecting the relevent value. Coz if i use command start.session, i do not need to use the import and export funda. 4th variable does the job.

Thanx a million
Shree

george7a
11th December 2006, 15:56
I am glad I could help :)