One script vs multiple scripts

Although there may be a small overhead of running multiple scripts, if your site has distinct requirements for the same views and screens, it is possible and often advisable to keep the scripts separate. It makes development and maintenance much easier. 

The things to consider are :

  1. You can have two or more subclass scripts on a Sage 300 screen - just as you can on views

  2. In some instances, it makes sense to have the scripts in one file (e.g. shared code, needing to put one button beside another etc)

  3. In some instances it makes sense to have them in separate files (e.g. easier to distribute changes, easier to test separately)

  4. There is a small overhead in opening multiple .py files when the screen first opens (or when the view is loaded for View Scripts)

Noteworthy

  1. Consider the new feature of using a Shared Python environment if using multiple scripts.

  2. You can import a script already in the database in a script - This avoids duplication of shared code. This is available since Extender PU7.10 - Importing other scripts

  3. You can control the order of the view scripts. Use "Run Order" in View Events, Scripts and workflow.