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 in Studio, select Server Development | Script Action, and click on the Create 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: Checked
- Script: (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...