link UI action from catalog variables

Deep_D
Tera Contributor

Hi All 

 

I have created a Button called print on the request item table so when a user clicks on it this will generate a pdf as sc_req_item(1) but now I want to replace the name with the Name of the variable from the catalog item using below script.

Script:

function exportPDF() {
var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var a='https://xxx.service-now.com/';
var url = a+sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;
g_navigation.openPopup(url);
	} 

Deep_D_0-1690777307816.png

 

 Thank you

1 REPLY 1

Samaksh Wani
Giga Sage
Giga Sage

Hello @Deep_D 

 

Add this :-

 

var file = "Name of the Variable";
current.file_name=file;

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh