- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 11:08 PM
Hi All
There are two buttons in the incident.
One by one UI action works correctly. I want to unify them into one button. Is there a way?
The script of each button is as follows.
Save Button
Script
===================
current.update();
action.setRedirectURL(current);
===================
There is a button to update the ticket for the instance in the copy environment
onClick →setSave()
Update Button Script
===================
function setSave() {
var Number = g_form.getValue();
var url = new GlideURL('Incident ticket of the update destination instance');
var w = getTopWindow();
var newWindow = w.open(url.getURL(), "_blank");
newWindow.focus();
return false;
}
===================
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 11:17 PM
Hey Taichi,
As you can see in both of the codes that one works on Server and one on client. So what i can suggest you is you can either create a new UI action and combine both codes with the help of gsftSubmit or you can edit any of the existing UI action and put both the codes executing on different sides (Server and Client).
You need to run the Save button code on Server and another one on client which will use onClick function. To do this you need to understand how to use gsftSubmit please refer to the link below to understand gsftSubmit.
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
If you have any query then you can ask me, also please don't forget to mark my answer Correct and Helpful.
Thanks and Regards:
Utpal Dutta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2020 11:17 PM
Hey Taichi,
As you can see in both of the codes that one works on Server and one on client. So what i can suggest you is you can either create a new UI action and combine both codes with the help of gsftSubmit or you can edit any of the existing UI action and put both the codes executing on different sides (Server and Client).
You need to run the Save button code on Server and another one on client which will use onClick function. To do this you need to understand how to use gsftSubmit please refer to the link below to understand gsftSubmit.
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
If you have any query then you can ask me, also please don't forget to mark my answer Correct and Helpful.
Thanks and Regards:
Utpal Dutta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2020 12:29 AM
If i was able to answer your query then please mark it Correct as well.
Thanks and Regards:
Utpal Dutta