Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change variable set display title on onload client script

vai
Kilo Contributor

I am using a variable set on my catalog item which has display name 'Vendor Employee Details' , i don't want to display this title on my catalog item, instead i want it to be 'Employee Details'

 

How can i change this using a catalog client script ??

6 REPLIES 6

Munender Singh
Mega Sage

Hi,

You can use this piece of code in your client script:

g_form.setLabelOf('field_name',"Employee Details"); //field_name is the dictionary name of Vendor Employee Details

Regards, 

Munender

vai
Kilo Contributor

I have tried it but no luck, is 'field' referring to the internal name of the variable set ?

It seems to be for variables. I have tried the following with variable set and it works

 

function onLoad() {
	var doc_elem = document.getElementById('label_' + g_form.getControl('test_set_va').id);
	doc_elem.innerHTML = 'NEWWW LABELL';
}

 

The field would be the internal_name of the variable set

PS - make sure the isolate_script is set to 'false'