- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2017 08:11 AM
Hi,
I want to remove the date & time stamp and user info from my email notification and only want the text message. I am doing it on comment field for RITM.
Kindly help me to fix this
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2017 09:37 AM
Your mail script would look something like this. Note, this is not a drop-in solution. You should understand what it does and make appropriate modifications for your table, field, and desired results.
var comment = current.comments.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
template.print(comment.replace(dateRE, ''));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 06:01 AM
You can do something like this:
var work_notes = current.u_work_notes.getJournalEntry(1);
var pos = work_notes.indexOf("\n");
gr.work_notes = work_notes.substring(pos);;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 06:06 AM
I managed to solve it just by doing like this:
var comment = current.u_work_notes.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
gr.work_notes = comment.replace(dateRE, '');
But thanks anyway!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 06:12 AM
I was going to go with a regular expression first, but didn't want to overcomplicate it (especially if the user changes their date format). Glad you found a solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2018 09:22 AM
So this helped me get the last comment in an incident to populate in the closure note section.
Needed to modify it some, but the var pos and the substring was great.
I did end up adding .trim(); to the end of the 'current' line that I had to trim out the space that was left from stripping in the indexOf.
Thanks Chuck!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2019 03:10 AM
Hi Chuck Tomasi,
As you mentioned above I understand but I need clarification to where to put this regular expression exactly like in email template or anywhere.
Thanks
Susmitha