global UI button behavior

Shafiuddin Shai
Tera Contributor

Hello experts,

 

Here the scenario is, to redirect the change_request form to the list of all open change_requests page on click of 'Update button' (this is a global UI action, by default behavior is routing to previous page). I tried to achieve it by onSubmit client script but no luck. Your inputs will be appreciated. Thanks in advance.

 

Regards,

Shafi

9 REPLIES 9

rambo1
Tera Guru

Hi @Shafiuddin Shai 

Create a new UI action for change request table and over ride the global UI action and then 

try below line of code at end in UI action:

action.setRedirectURL('change_request_list.do?sysparm_query=active%3Dtrue');

Hi @rambo

Thank you for your response. I created a new UI action on the change_request table and added a condition to the OOB UI action button ( current.table_name != 'change_request') to hide it only on the change request form. It works perfectly. Thank you!

Adding additional condition on OOTB UI action would skip it during upgrade.

Could you please mark helpful/correct and close this thread

Ankur Bawiskar
Tera Patron
Tera Patron

@Shafiuddin Shai 

the update button takes user to list of records. Ideally it should do OOB

Did you check the OOB UI action on global table?

If it still doesn't work then do these steps

1) Open this OOB UI Action. replace your instance name

https://instanceName.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=42df02e20a0a0b340080e61b551f2909

2) Change the table name to change_request and update script as this (add line 4)

3) Do Insert and Stay on the form

AnkurBawiskar_0-1735789806348.png

 

Then verify

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader