- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 04:46 AM - edited 01-31-2024 04:49 AM
Hello Community,
I have a problem where I am trying to add comments of approval records to Parent record, this parent record have more then one approvals.
The script which i have written is adding comments from only 1 approval record.
This script I have on Flow designer script for work notes field.
Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 06:44 AM
Hello @Nikhil80 ,
Please give a try to the code below and see how it works for you.
var RecordID = fd_data.trigger.current.sys_id;
var appRec = new GlideRecord('sysapproval_approver');
appRec.addQuery('document_id', RecordID);
appRec.query();
var allComments = "";
while (appRec.next()) {
var comments = appRec.comments.getJournalEntry(1);
var name = appRec.approver.name.getDisplayValue();
allComments += "Case is Approved by " + name + '\n' + comments + '\n';
}
return allComments;
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 06:44 AM
Hello @Nikhil80 ,
Please give a try to the code below and see how it works for you.
var RecordID = fd_data.trigger.current.sys_id;
var appRec = new GlideRecord('sysapproval_approver');
appRec.addQuery('document_id', RecordID);
appRec.query();
var allComments = "";
while (appRec.next()) {
var comments = appRec.comments.getJournalEntry(1);
var name = appRec.approver.name.getDisplayValue();
allComments += "Case is Approved by " + name + '\n' + comments + '\n';
}
return allComments;
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket