popeye
24th January 2002, 23:02
Hi,
I want to launch a session directly from the "Run" option - Windows.
I am using the following command
c:\baan040c-old\bin\bw c:\baan040c-old\lib\user\default.bwc tdpuro247m001
This launches the session.
Now I need to pass a variable (Company) to the session.
How do I do it?
Thanks.
Cheers,
Madhu
francishsu
24th January 2002, 23:37
You can set the environment variable BSE_COMPNR=<company> in the Baan user config file to override the starting company.
However, using this method you'd either have to create a config file for each company to run the session, or program something to dynamically create a config file and execute it.
Another possibility would be to create a library in Baan that would change the user's company and execute a session. Then create a program to execute the library using the OLE interface to Baan.
lbencic
24th January 2002, 23:47
There is no argument to accept the company number, you will need coding as mentioned above or they must change the company number before launching the session. I guess the library would be the best call. Use the "switch.to.company" command and all subsequent sql will be based on the new company.
You don't need all that bw path info in the run command. Just put in the session number to run:
tdpuro247m001
Unless the "old" stuff in your path means it's not in the current BSE path...?
popeye
25th January 2002, 00:25
By "Run", I meant ...
Check the attached pic ... it'll be easier than explaining :)
lbencic
25th January 2002, 00:31
No attachments are coming through, Madhu
popeye
25th January 2002, 00:31
forgot to attach the pic
popeye
25th January 2002, 03:04
c:\baan040c-old\bin\bw c:\baan040c-old\lib\user\default.bwc -- -set BSE_COMPNR=475 tdpuro143m001
popeye
25th January 2002, 03:05
Hi,
I got the solution.
Thanks a lot for all the posts.
c:\baan040c-old\bin\bw c:\baan040c-old\lib\user\default.bwc -- -set BSE_COMPNR=475 tdpuro143m001
Cheers,
Madhu
francishsu
25th January 2002, 19:10
I didn't know that you could set environment variables like that on the command line. Makes things alot simpler! :)
victor_cleto
26th January 2002, 21:48
Francishsu,
Take a look at the thread here for command line parameters:
http://www.baanboard.com/baanboard/showthread.php?s=&threadid=95