Modify (customer visible) message on Additional comments field on problem table

Sk Sharukh1
Tera Contributor

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 ?

 

SkSharukh1_0-1673512744305.png

 

1 ACCEPTED SOLUTION

@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

jaheerhattiwale_0-1673525971381.png

 

Result:

jaheerhattiwale_1-1673526177469.png

 

 

Please mark as correct answer if this solves your issue.

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

6 REPLIES 6

@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

jaheerhattiwale_0-1673525971381.png

 

Result:

jaheerhattiwale_1-1673526177469.png

 

 

Please mark as correct answer if this solves your issue.

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale  Thank you It worked !!