ScriptLink Triggers
ScriptLink is triggered by an event configured on a form in myAvatar. You can activate the scripts that are configured by interacting with the form (opening the form, submitting it, interacting with fields). Form-level events, field-level events, and ScriptLink button events are different ways you can configure a user interaction to trigger ScriptLink to call on a web service.
Form-Level Events
There are three form-level events that can be configured to trigger ScriptLink.
Form Load
A form load is when Scriptlink is set to trigger when a form loads. The script is executed after any pre-display selections are made, but before the form is displayed to the user. Because this event occurs before the form is displayed, you can use it to override values that are present on a form that is being opened for editing.
Combined with ScriptLink error codes, you can also prevent a user from opening a form using ScriptLink on form load.
Prefile
A prefile is when a submit button is clicked and form filing triggers ScriptLink. This kind of event event occurs after the submit button is clicked, but before any information is saved to the database. ScriptLink configured to be triggered by a prefile event can check or update values on the form before it is filed.
Combined with ScriptLink error codes, you can prevent a form from being filed using ScriptLink on prefile.
Postfile
The postfile event type occurs after the submit button is clicked, and after the updated form information is saved to the database.
Field Events
ScriptLink can be configured on individual fields.
Field types that can be configured to trigger ScriptLink code:
- Text
- Date
- Time
- Dropdown
- Radio button
- Checkbox
- Search fields
For controls where the user must type in a text value or number, the script is triggered when the field loses focus. Tabbing to a different field, or clicking on a different field will cause a field to lose focus.
For fields with single or multiple selections, changing the selected item or items will trigger the script.
ScriptLink Buttons
In cases where form-level events and field events are not good choices for ScriptLink triggers, a dedicated trigger button is needed.
myAvatar provides ScriptLink buttons so that you can configure an event to be triggered.
