Script actions are server-side JavaScript code that is executed when an event it is listening to is triggered on the specified table. Just like any other server-side script, script actions have access to all the server-side glide APIs, script includes, and other server-side resources.
The following steps show you how to create a script action:
- Open the
Create New Application File
wizard inStudio
, selectServer Development
|Script Action
, and click on theCreate
button. - Fill in the new script action record form with the following values:
Name
:Update Reassignment Count
Event
:x_8940_travel_book.assigned_to_changed
Active
: CheckedScript
: (Use the following mentioned code)
- Write the following code in the script field:
current.reassignment_count += 1; current.update();
In the preceding code, we are incrementing the reassignment_count
field by 1
and then updating the record. The system usually takes a few seconds to update the record because the control is returned...