How to copy both work notes and additional comments in a field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 12:28 AM
Hi All,
We are using OOB Time Worked functionality on incident form So I would like to copy the latest Additional Comments /Work notes entered on Incident to comments field in Time worked table.
I wrote a before insert/update BR
var workNotes = current.task.work_notes.getJournalEntry(1);
var additionalComments = current.task.comments.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
if(additionalComments){
current.comments = additionalComments.replace(dateRE, '');}
if(workNotes) {
current.comments = workNotes.replace(dateRE, '');
}
But it is updating either work notes or comments
If I first enter comments it is updating comments later if I enter worknotes it is still updating the last comments which i entered previously instead of the lates worknotes.
Please suggest where I am going wrong
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 03:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2020 03:28 AM
AS far as the YouTube video, attempt using the "Embed" URL. So from the website online for your video, click on "Share" then "Embed", then choose the URL from within the quotations:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2020 03:34 AM
AS a ways because the YouTube video, attempt using the "Embed" URL. So from the net website online online on your video, click on "Share" then "Embed", then pick out the URL from in the quotations.
Hello,
Try the below script:-
Regards,
Mohammed Iqbal