Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Server-side scripts allow the system to run the JS scripts on the server-side when the server events happen, for example:
- writing or updating any data in the database
- an incoming message
- due date and time occurrence
- calling specified UI action
- the Run Script activity processing within a workflow.
They are used for creating reactions for the data writing based on the pre-defined rules, such as:
- database transaction interrupting
- new system object creation
- associative record creation (once the record is created, one more will be created in return)
- the context-dependent value calculation
- a configuration of the record creation initiated by incoming email (the incident is created upon receipt of an email), and so on.
In the server-side scripts, you can use native JavaScript and methods provided by server-side API.
Note | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
To define the API class in a script, you need to specify it explicitly in the script code, for example:
In the case there is a code executed through the eval() function, adding the string below at the start of the script imports all the API classesYou can import all the API classes by adding the string // #import_all_types at the beginning of the script executed through the eval() function.
|
The following sections give contain more details and specifics of server-side scripts usage.
Page Tree | ||
---|---|---|
|
Also, you can refer to the Scheduled Script article to get more information about implementing routine activities.