- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 06:37 AM - edited 02-26-2024 06:37 AM
Hi All,
I need to send worknotes if any certain keywords are present. Need to extract the string next to that keyword and send remaining text in the notifications line by line.
Worknotes:
abc
def
ghi
ijk
***notes***
line1
line2
line3
I am trying with below script. Notes are printing as continuous text in email. But in logs printing line by line.
var strm = current.work_notes.getJournalEntry(1).match(/\n.*/gm).join('').replace(/^\s*\n/gm, "");
var text = strm.trim();
var text1=text.indexOf("Notes");
if (text1!= -1) {
var text2 = text.slice(text1);
gs.info("text1" + text2);
gs.eventQueue("notify.worknotes", current, 'abc@gmail.com, text2);
Please assist me on this. Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:30 AM
Hello @Madhavi2 ,
Can you please cheange 1st line with the below line -
var strm = current.work_notes.getJournalEntry(1).replace(/\r?\n/g, "<br>");
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:30 AM
Hello @Madhavi2 ,
Can you please cheange 1st line with the below line -
var strm = current.work_notes.getJournalEntry(1).replace(/\r?\n/g, "<br>");
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:57 AM
Hi @chetanb ,
Thank you so much. It worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:03 AM
It's great to know.. marked as helpful so that other also can get benefitted if they are looking for the same.