Code To Change Section Name

kumarsatyam
Tera Expert

Hello vinitha,

Here we can discuss.

I have three sections R1,R2 and R3.

When my form loads there is a field which fetches New Section name from another table (Config table)

Only i have to do is Whenever form loads R1,R2 and R3 should be changed by that New Section Names which will come from Config Page .

Please help from a beginning.

Regards,

Kumar

15 REPLIES 15

Karthik Reddy T
Kilo Sage

Hello Kumar,



Try System UI>Form Sections.



Refer the below links may helpful to you.



http://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scri...




Section Name Change


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

var currentLabel = 'Candidate Registration Test';


var newLabel = 'Changed Label';


var labelEl = $$('.form_header')[0];


var newHTML = labelEl.innerHTML.replace(currentLabel, newLabel);


labelEl.innerHTML = newHTML;




This is Applicable for Table Name Change (0 th Position Section ) But for 1th Position (R1 Section ) .



it is not applicable when i am writing var labelEl = $$('.form_header')[1];   instead of 0 th element.



Do you have any idea why it is not working...


vinitha3
Tera Guru

Hi Kumar,



Try this,



$$('.tab_caption_text').each(function(caption) {


if(caption.innerHTML == 'R1'){


caption.innerHTML = 'NewR1';


}



Thanks,


Vinitha.K


Perfect. Thank you so much . it worked perfectly. (y)



Regards Kumar _/\_