Extra line breaks in description field

ritaaudi
Tera Contributor

When creating an incident from the incident form, the description field adds line breaks. Does any one know if there is a way to prevent the additional line breaks? Thanks! Rita

1 ACCEPTED SOLUTION

try to replace \n


-Anurag

View solution in original post

8 REPLIES 8

mike_allgire
Giga Guru

Are you sure there isn't caused by input method or a custom business rule? The default description field is just a string field and doesn't have any function. Can you give more details?


Hi Mike:


Thanks for responding to my question. Here's more info:


When creating the incident, I entered the following text in the Description field:


line 1


line2


After saving I got the following:


line 1



line 2


I even created a business rule on incident table to delete line breaks with the following code:


current.description = current.description.replace(/<br\/>/g,'');


gs.log("description=" + current.description);



The logs show no line breaks, yet the Description on the form still has line breaks.


Any advice you have is much appreciated!


Rita


Is your description field still a String or was it changed to an HTML field? If it is HTML, then ServiceNow is probably adding a new paragraph tag that it thinks is missing, which happens all the time through the WYSIWYG. I can't replicate this issue using a string field, or with an HTML field in the latest version of Fuji.


try to replace \n


-Anurag