- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 12:43 AM
The (customer visible) message I should not see on the problem record , I know that there is client script called "Modify Comments Label" running on the task table , From that It is coming , But I should not modify the existing client script , I want to create another client script to remove the (customer visible) on the problem form .
How to achieve this with code ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:23 AM
@Sk Sharukh1 Tried and tested solution.
Add below code to the newly created client script:
function onLoad() {
if (!g_user.hasRole("itil"))
return;
if (!g_form.hasField('comments'))
return;
var labelText = g_form.getLabelOf('comments');
if (labelText.substring(labelText.length-1) == ':')
labelText = labelText.substring(0, labelText.length -1);
labelText = labelText.split("(Customer visible)")[0];
g_form.setLabelOf('comments', labelText);
}
And after saving the client script make the order as 1000 like below from list view as order field is not available in form layout
Result:
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:23 AM
@Sk Sharukh1 Tried and tested solution.
Add below code to the newly created client script:
function onLoad() {
if (!g_user.hasRole("itil"))
return;
if (!g_form.hasField('comments'))
return;
var labelText = g_form.getLabelOf('comments');
if (labelText.substring(labelText.length-1) == ':')
labelText = labelText.substring(0, labelText.length -1);
labelText = labelText.split("(Customer visible)")[0];
g_form.setLabelOf('comments', labelText);
}
And after saving the client script make the order as 1000 like below from list view as order field is not available in form layout
Result:
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 04:51 AM
@jaheerhattiwale Thank you It worked !!