Script includes used to store JavaScript functions and classes that will execute on the server. Script includes specify either object class or function.
Role required: admin.
The script include form
A script include has a name, a description, and a script itself. Also, it is possible to specify if it is active or client-callable.
To create a new script include, please complete the following steps:
- Navigate to System Definition -> Script Includes.
- Click New, fill in the form, and click Save.
Field | Description |
---|---|
Name | Script include name, |
Description | Short action description, |
Active | When set to TRUE, this script will execute when called; otherwise, it will not execute. |
Client callable | When set to TRUE, this script will be callable on the client-side; otherwise, it will not. |
Script | Define the server-side script to run when called from other scripts. When invoking script includes in other server-side or client-side script, please use the ss.importIncludeScript method of the SimpleSystem class like shown on the example below: ss.importIncludeScript('Animal'); let animal = new Animal(); Otherwise, you potentially may face problems with script importing. |