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 and fill in the fields.
- Click Save or Save and Exit to apply changes.
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 available to call on the client-side scripts. |
Script | Define the server-side script to run when called from other scripts When invoking script includes in other server-side scripts, please use the ss.importIncludeScript method of the SimpleSystem class like shown on the example below: ss.importIncludeScript('EmailHelper'); const helper = new EmailHelper(); Otherwise, the script would be unavailable. |