Running a script with run.exe

Extenderincludes run.exe in the VIxxA folder, which allows running Extender scripts from the command line.

There is also a sample script, cli.py.sample. You can upload the cli.py script in the Extender Scripts screen.

Why use this?

You can run an Extender script in a Sage 300 database from the command line. This is useful to run background processes, without a user intervention.

How does it work?

In the VIXXA of your Sage 300 installation, you can run the program: run.exe, with the following parameters.

run {user} {password} {orgID} sample.py "first argument" second third

{user} and {password} are the credentials to logon to Sage 300

sample.py: Name of the Extender script. It needs to be uploaded in the database.

If the script requires arguments, add all the required parameters.

Design principles for the script

  • Include a main function.

  • Do not include a UI in the script.

  • To display a message, use print(). Scripts cannot use showMessage() or showMessageBox() functions.

  • If the script doesn't require parameters, ensure the main function allows blank arguments

Example:

Hello World