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.

 

View solution in original post

6 REPLIES 6

manjusha bangal
Tera Contributor

Hi Sk,

 

Just check sys_document table which holds label change ,try to change label from table .

Thanks,

Manjusha Bangale

Hi Manjusha,

Iam referring to (customer visible message ) which is highlighted in the above screenshot

jaheerhattiwale
Mega Sage

@Sk Sharukh1 You can create a similar client script like "Modify Comments Label" on problem table and remove the (Customer Visible) from it.

 

Please mark as correct answer if this solves your issue.

@jaheerhattiwale , Still able to see the same (customer visible field ) message after removing also

 

code below:

 

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 += new GwtMessage().getMessage(' ');
g_form.setLabelOf('comments', labelText);
}