The Now Platform® Washington DC release is live. Watch now!
07-19-2017 06:28 AM
Hello,
I want to copy the chat history in the description of the field.can some one help me in this?
var desc='';
var notes = conversation.document.comments.getJournalEntry(-1);
if (notes.indexof("[code]") == -1) {
var wrappedNote = "[code]" + notes + "[/code]";
notes = wrappedNote;
}
// var na = notes.split("\n\n");
// for (var i = 0; i < na.length; i++)
// {
// desc ="\n\n\n"+desc+na[i]+" "+"\n\n\n";
// }
response.newRecord("new_call", {
short_description: "",
caller: conversation.document.opened_by,
opened_by: gs.getUserID(),
contact_type: "Chat",
description: notes
});
But its hows like below.Is there way to show it as line by line
Thanks
Saranya
08-29-2017 07:13 AM
Saranya,
You can accomplish this by replacing this line:
var wrappedNote = "[code]" + notes + "[/code]";
With this line:
var wrappedNote = "[code]" + notes + "[/code]\n\n";
Please mark as answered if this correctly resolves your issue.