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:


FieldDescription
NameScript include name
DescriptionShort action description
ActiveWhen set to TRUE, this script will execute when called; otherwise, it will not execute.
Client callableWhen 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('Animal');
const animal = new Animal();

Otherwise, the script would be unavailable.