- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2025 07:41 AM
i have a requirement to change the short description label to Title when for a specific company.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2025 07:44 AM
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2025 07:44 AM
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
-------------------------------------------------------------------------