The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Right click and 'Save' script

jibingnan
Kilo Explorer

When I right click the top of the head, a list was shown as the picture added, and there was 'Save' button on it.

I want to add some scripts when I click the save button, where can I write the script?ask.PNG

4 REPLIES 4

Geoffrey2
ServiceNow Employee
ServiceNow Employee

You need to create your own UI Action.


But there's the existed function already, I can update the form with clicking the save button.


And many users are using this function.


So I want to script on the save button, so that I can control the update operation.


Inactive_Us1474
Giga Guru

Instead of using the Save button which is present in oob global table, create a custom button (UI Action) and create custom script for this.


G_Ede
Tera Guru

The save button there is just a UI Action.   Try navigating to System Definition -> UI Actions and filtering the list for records where Name is "Save" and Form Context Menu is true.   On a fresh Personal Developer Instance I can see 26.



Some of these UI Actions are inherited by a lot of tables, so best practice (as suggested by others) is probably to override the UI Action for the table(s) you're interested in by creating new UI Actions that do what you want.   You can override (replace) the existing UI Action by following the steps from this Docs page.