Hi there all experts.
Recently I have write a JS that modify the description of the quote.
The functionality works fine,
But I do now know why it removes the new line character(/n).
My description is sentence by sentence.
At the beginning of each sentence there is a dash character (-).
Here is the script.
function addServices(ServiceNames) { var descriptionAttribute=Xrm.Page.getAttribute("description"); var descFieldText = descriptionAttribute.getValue(); var txt=validateIfExist(descFieldText); // It search for a specified sentence in the description and return that if that exist. if(ServiceNames) { if(txt) { descFieldText=descFieldText.replace(txt, "It Includes : " arvandServiceNames); descriptionAttribute.setValue(descFieldText); Xrm.Page.data.entity.save(); } } }
It works fine and replace the description with desired text.
But It removes all the new line(/n).
How can I handle it so that I can keep new line?
Any help will be appreciated.