Auto-Populate Current username and email-id in worknotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 12:03 PM
Hi All,
I am working on a requirement wherein When anyone updates the worknotes in incident form then along with the notes username and mail id should also be auto-populated in the same worknotes field.
Please help me with this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 07:10 PM
Try updating your BR as below:
(function executeRule(current, previous /*null when async*/) {
var agent_email = "[code] <a href='mailto:'" + gs.getuser().getemail() + ">" + gs.getuser().getemail() + "</a>[/code]";
var notes = current.getvalue("work_notes");
current.work_notes = gs.getUserDisplayName() + "\n" + agent_email + "\n";
})(current, previous);
I tried it and the code does not duplicates your work notes.
Please mark my response as helpful and as a solution, after you try it successfully.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 11:25 PM
I have tried this It will not give duplicate but It will create two separate record in sys_journal_field table. I want one single record to be created If I post my worknotes. If it is possible please tell me how can I achieve it.