Get Started with Python 3 Script

Python is a dynamic programming language that is freely available and easy to learn.

Orchid has implemented PYTHON 3 scripting around the Sage 300 Views and Sage 300 desktop screens, so site specific business logic can be implemented using PYTHON 3 scripting and applied to Sage 300 core and 3rd Party Views (if they are developed in the Sage 300 SDK) – when records are inserted, updated and deleted.

Useful Resources

Google “PYTHON 3 Tutorials” and you will find many sites. Some useful ones are

https://wiki.Python.org/moin/BeginnersGuide

https://www.Python.org/about/gettingstarted

http://www.Python-course.eu/Python3_course.php

Sample scripts

Sample PYTHON 3 scripts from Orchid are installed in the VIXXA\Scripts folder of the directory where Sage 300 is installed.

Importing Python libraries/packages in a script

Some Python libraries are installed with the Extender install. You can then import them in an Extender script.

If you want to use a Python library that is not installed with the Extender install, you can add the following line #@ pip(libraryname) to the script that requires the library.

For details, refer to: Importing Python packages

Troubleshooting using Online debugging tool

You can use https://www.onlinegdb.com/online_python_debugger to help troubleshoot scripts. It helps identify Python related issues (but it's not specific to Sage 300).

This is particularly useful when you get an error loading a script in Extender Setup > Scripts.

Select the script with an error in your preferred Text Editor, Copy to the clipboard and Paste in the Python Editor. If the script has a syntax error, such as wrong indentation, it will point to the line with the error.

Even with a valid script, you will see errors relating to the accpac.py - You can ignore such errors.

See Also

Tips to get started with Extender scripts

Getting Started with Extender