How to put text inside the Additional Comments text box on the incident form

NancyS1
Tera Expert

We'd like to put text inside the Additional Comments text box on the incident form to tell the tech to put comments there to communicate with the customer. We have help text, but people don't necessarily think to hover over that field. I thought about a template, but it should be there for everyone, not dependent on someone adding it.

I've searched, but the results I'm finding have more to changing the name of the field or adding the hover text. 

Here's an example that was done by a previous contractor on the Work Notes field: 

find_real_file.png

7 REPLIES 7

Pranav Bhagat
Kilo Sage

You can try adding a placeholder to it

The best way would be:

var workNotes = g_form.getControl("work_notes");
if(workNotes) {
workNotes.placeholder = "New Placeholder for Work Notes";
}

var comments = g_form.getControl("comments");
if(comments) {
comments.placeholder = "New Placeholder for Additional Comments";
}

 

find_real_file.png

Other way is to use DOM Manipulation 

var workNotes = gel("activity-stream-work_notes-textarea");
if(workNotes) {
workNotes.placeholder = "New Placeholder for Work Notes";
}

var comments = gel("activity-stream-comments-textarea");
if(comments) {
comments.placeholder = "New Placeholder for Additional Comments";
}

 

Which works, but since it is doing DOM Manipulation which is not a best practice so I don't recommend the second approcah.

 

Regards

Pranav

Thanks alot bro, it helped.

Hi Pranav,

Thank you so much for the above code working as expected i have one query is it also work in agent work space?

Regards,

Susmitha.

Jaspal Singh
Mega Patron
Mega Patron

Hi Nancy,

 

You need a simple Display Business rule on Incident table with script as below.

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.comments='Details:\nID:\nAny other comments:';

})(current, previous);

find_real_file.png