Journal Field new line is not working through script

neethu4
Giga Expert

Hi All,

I used this below code for adding note in comment field but "\n" is not giving new line in comment field.

Please let me know any issue in this script

var comments_ritm = " This case has been created from "+number;

var comments = current.comments.getJournalEntry(-1);

ca.comments = comments_ritm+"\n\n"+comments;

Thanks,

Neethu

1 ACCEPTED SOLUTION

neethu4
Giga Expert

The issue got fixed by using following script


var number= gs.getMessage(["[code]<a   href =sc_req_item.do?sys_id="+ current.sys_id +">"+ current.number +"</a><p>[code]"]);


var comments_ritm = " This case has been created from "+number;


var comments = current.comments.getHTMLValue();


ca.comments = comments_ritm+comments;


View solution in original post

11 REPLIES 11

neethu4
Giga Expert

I believe the issue is with Code tag ,if i remove that it will show the work notes with \n.But it required as the RITM number should be updated as hyperlink


neethu4
Giga Expert

The issue got fixed by using following script


var number= gs.getMessage(["[code]<a   href =sc_req_item.do?sys_id="+ current.sys_id +">"+ current.number +"</a><p>[code]"]);


var comments_ritm = " This case has been created from "+number;


var comments = current.comments.getHTMLValue();


ca.comments = comments_ritm+comments;