UI Action to open CI reference in new tab.

Jbelter
Tera Guru

Hi All,

 

I am trying to create a UI Action Script on the sc_req_item table that opens its related configuration item in a new tab. However, I can't seem to get it to work...
Here is what I have right now,

Active = True, Show insert = True, Show update = True, Client = True, Form button = True
Onclick = deploy_request(), Condition = current.configuration_item != NULL

function deploy_request() {
	var url = 'cmdb_ci.do?sys_id='+current.configuration_item;
	g_navigation.open(url);
}

Currently, the button doesn't seem to do anything...

1 ACCEPTED SOLUTION

Hemanth M1
Giga Sage
Giga Sage

Hi @Jbelter ,

current will not work if you check client, please use the below script 

function deploy_request() {
var url ="cmdb_ci.do?sys_id="+g_form.getValue("configuration_item"); //url
g_navigation.open(url, '_blank'); //open in new tab

}

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

2 REPLIES 2

Hemanth M1
Giga Sage
Giga Sage

Hi @Jbelter ,

current will not work if you check client, please use the below script 

function deploy_request() {
var url ="cmdb_ci.do?sys_id="+g_form.getValue("configuration_item"); //url
g_navigation.open(url, '_blank'); //open in new tab

}

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

This worked great, thank you! 😁