batmush
27th April 2007, 22:29
Hi,
How can I run BaaN session from Windows command line?
For example, run tibom1411m000 with Item number as a parameter and export into file.
Thank you in advance.
mark_h
27th April 2007, 22:38
You could write a VB program that takes the parameter and runs tibom1411m000 in the background(using Baans API interface). See the DDC/OLE/AFS forum.
en@frrom
2nd May 2007, 13:35
or add the session name and parameters in the cmmand line of the .bwc configuration file...
GaryEd
27th September 2010, 22:23
Can you give an example of how to fill the command line of the bwc to run a session and pass the parameters?
mark_h
28th September 2010, 17:35
In the bwc configuration all you do is put the session name in the command box. Not sure how to actually pass parameters.
GaryEd
28th September 2010, 18:13
Thanks Mark,
I know we can put a session name in the command line. We use that fairly often.
The earlier post from en@frrom implied that it was possible to also pass parameters through the command line. That was what I was lookng for more info on.
en, are you still visiting baanboard?
Han Brinkman
29th September 2010, 13:49
Gary,
I know at least a work around:
- create a job that's performing the thing(s) you want;
- you can start the job using a commandline;
- just before doing this use some external program that modifies the ttaad503 table changing the job parameters.
Another way: write a session that read's your parameter from e.g. a file, use afs to start the export session. Start this session using the job method.
Regards,
Han
mark_h
29th September 2010, 16:46
Well on the unix platform on the actual command line I can set environment variables and then read them into the program using getenv$. I am not sure there is an equivalent on the windows OS your profile shows. I can have a command line like -- -set SITE=XX1 tiudi3430m000 - the the session tiudi3430m000 could use the site environment variable to execute some action.
shah_bs
30th September 2010, 20:22
I am curious why you have this requirement. Maybe you have a different session in mind and are using tibom1411m000 simply as example.
My understanding is, unless the session is customized to recognize command line arguments, running it from the command line will just bring up the form so we can still continue and type in the required values and make the session run.
For example, I tried the following:
bin/bw.exe tibom1410m000 itemcode1 itemcode2
and the screen for tibom1410m000 came up as if I had run it from the menu. itemcode1 and itemcode2 were just ignored.
So, then I tried the following code:
before.program:
item.f = argv$(1)
item.t = argv$(2)
message(item.f)
message(item.t)
and ran the session as before and the message commands showed me the values that I had passed to the command line. So, as far as customization goes, in the case of tibom1410m000, I would assign the first value to item.f, the next to item.t, (and so on) and then also customize to make the session pick ASCII as the device, force in some output file name, and make it proceed to choice.cont.process to get my output file.