Change short description to Titile

Prakash_S
Tera Contributor

i have a requirement to change the short description label to Title when for a specific company.

1 ACCEPTED SOLUTION

Runjay Patel
Giga Sage

Hi @Prakash_S ,

 

You can write below script in onload client script.

var shortDescriptionField = g_form.getControl('short_description');
var company = g_form.getValue('company');
    if (shortDescriptionField && company='sys_id of the company') { // replace sys id of your specific company
        // Change the label text
        var label = shortDescriptionField.closest('div.form-group').querySelector('label');
        if (label) {
            label.textContent = 'Title';
        }
    }

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

View solution in original post

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently
1 REPLY 1

Runjay Patel
Giga Sage

Hi @Prakash_S ,

 

You can write below script in onload client script.

var shortDescriptionField = g_form.getControl('short_description');
var company = g_form.getValue('company');
    if (shortDescriptionField && company='sys_id of the company') { // replace sys id of your specific company
        // Change the label text
        var label = shortDescriptionField.closest('div.form-group').querySelector('label');
        if (label) {
            label.textContent = 'Title';
        }
    }

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently