How do I stop the additional comments field from displaying (Customer Visible)

resoldab
Kilo Contributor

I have created a table extended from the task table.

I am using the Additional Comments field and renamed to "Executive Comment"
This is being used for internal comments from another department.
The form shows the correct label of "Executive Comment" but always shows (Customer Visible) in the label and comments box.

How do I stop this, the comments will not be customer visible and I don't want this shown.

Thanks
Steve

find_real_file.png

 

1 ACCEPTED SOLUTION

The condition added is a NOT condition, so it wont apply to your table.  This will not affect globally and it will only remove the customer visible label from your table.

View solution in original post

3 REPLIES 3

Alikutty A
Tera Sage

Hello,

The text for additional comments come from a client script named "Modify Comments Lable" 

Here is its URL: 

https://instance_name.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=8e3c775a0a0a3c74010bedda85570a82

Replace instance_name with your instance name.

You will need to modify its logic to remove it from being displayed on your table. Here is the sample logic to use. 

eg: Add this logic inside an if condition

var table = g_form.getTableName();
if(table != 'Your table name here'){  //Replace your table name in it

}

Here is the actual script:

function onLoad() {
	if (!g_user.hasRole("itil"))
		return;
	
	if (!g_form.hasField('comments'))
		return;
	
	var table = g_form.getTableName();
	if(table != 'Your table name here'){
		
		var labelText = g_form.getLabelOf('comments');
		if (labelText.substring(labelText.length-1) == ':')
			labelText = labelText.substring(0, labelText.length -1);
		
		labelText += new GwtMessage().getMessage(' (Customer visible)');
		g_form.setLabelOf('comments', labelText);
	}
}

 

 

resoldab
Kilo Contributor

Hi Alikutty,

Thanks for this, very helpful.
Ignore- Will this just apply to my table or is this going to affect the global use of Additional Comments.

If I do the if conditional this will just apply to my table

Regards

Steve

The condition added is a NOT condition, so it wont apply to your table.  This will not affect globally and it will only remove the customer visible label from your table.