change the name of the Configuration item field to CMDB CI on the incident form only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 02:57 AM
Hey,
how to change the name of the Configuration item field to CMDB CI only on the incident form.
should work on the regular incident form and on the SOW form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 03:16 AM
Hello @ofekg
To change the label of the Configuration item field to CMDB CI on the Incident form (both the regular Incident form and any form with a State of Work (SOW) extension), you can use a Client Script with some conditional logic to modify the label dynamically.
Here are the steps to achieve this:
Navigate to: Incident > Client Scripts.
Create a New Client Script with the following details:
- Type: onLoad
- Table: Incident
Script: Add the following code to rename the field label for Configuration item to CMDB CI:
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getControl('cmdb_ci')) {
// Change the label of 'Configuration item' to 'CMDB CI'
g_form.setLabelOf('cmdb_ci', 'CMDB CI');
}
}
Save and Test:
- Open an Incident record and verify that the Configuration item field label is updated to CMDB CI.
- Check if it applies to both the standard Incident form and any custom forms (like the SOW form) if they inherit from the Incident table.
Additional Notes
- The setLabelOf() function will dynamically change the field label when the form loads, ensuring that it’s only applied to the cmdb_ci field on the Incident form, regardless of the view or form variant.
- This approach doesn’t impact the underlying field name or its reference, only the display label seen by the user.
"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 04:00 AM
thank you, it worked !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 04:23 AM
Hello @ofekg
If my solution helped you to resolve the query, could you please mark my solution as an accepted solution and give it a like by marking it helpful. This will help the community to recognize the solution easily and also motivates me to contribute more towards the community.
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2024 03:22 AM
Hi @ofekg ,
If you want to change only label of the filed then you can use
g_form.setLabelOf('cmdb_ci', 'Your Label');
or if you looking to change the behavior then you can do dictionary override.
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------