Script Actions
Scripting is an advanced option that allows you to execute a script when an action is triggered. Scripts can be executed under any set of conditions.
Example
A Script action runs when a new Training Signup record is created, which signs a new person up for training. The script copies two master KBs to create the Training KBs for the trainee, populates their passwords and login information, and then updates the KB record and Training Signup record with the information needed for a trainee to login.
Create a Script Action
You can access the Actions wizard in several ways, but the easiest way is to select Setup [Table] from the table where you want to create the action.
- From the top nav bar, expand the table's drop-down and select Setup [Table].
- Select the Actions tab in the Table wizard.
- Click Create Script Action.
Name your action and give it a description. The name of the Script action must match the name of the script file.
Once your action is saved the system automatically adds an S: before your given title to distinguish the action as Script.
- Click Finish.
- Locate and upload your script to one of the following server file installation directories, based on your server type:
- For Linux servers:
/usr/local/agiloft/data/[KB]/scripts
For Windows servers:
/agiloft/scripts
For security reasons, it is not possible to upload the file to the server from the browser. You must have direct access to the server.
- For Linux servers:
File Extensions
The following extensions designate how the script executes:
- .pl – Executed by the Perl interpreter
- .jar or .class – Dynamically loaded and run as a java class
- .bsh – Executed as BeanShell scripts
- .py – Executed as Python scripts
- .exe or any unrecognized extensions – Treated as executables