Retrieve latest public comment in flow designer data pill.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2020 11:08 AM
The below data pill retrieves all the public comments from the record, can it be setup to only retrieve the latest comment?
Labels:
- Labels:
-
Scripting and Coding
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2020 12:42 PM
///Can you check the log for source @@@TESTING
var gr = new GlideRecord(fd_data.trigger.current.getTableName());
gr.get(fd_data.trigger.current.getValue('sys_id'));
var all_comments = gr.comments.getJournalEntry(-1);
var latest_comment = gr.comments.getJournalEntry(1);
gs.log('all_comments = ' + all_comments + ' latest_comment = ' + latest_comment, '@@@TESTING')
return latest_comment;
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022
Vinod Kumar Kachineni
Community Rising Star 2022