How to place the attachment links in record producer table's description field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 11:23 AM
When the record producer is submitted, I need the attachment links to show up in my description field.
Here is the code. It works when I hardcode the sysid and test it in background script. But does not work within the record producer. Any suggestions?
var attachmentLinks = "";
var grAttach = new GlideRecord('sys_attachment');
grAttach.addQuery('table_sys_id', current.getUniqueValue());
grAttach.addQuery('table_name', current.getTableName());
grAttach.query();
while (grAttach.next()) {
gs.log("grAttach.sys_id-------------" + grAttach.sys_id);
attachmentLinks += gs.getProperty('glide.servlet.uri') + "sys_attachment.do?sys_id=" + grAttach.sys_id +"\n";
}
current.description = attachmentLinks;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 01:42 PM
I tried this with an incident RP I created in my (Xanadu) PDI. I used Service Portal, attached with the paper clip icon, without encryption, and the description was updated as expected. Is your RP in a scoped app?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 01:46 PM
All in Global scope.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2024 04:07 AM
Is what you shared the entire record producer Script, or are you doing other things before or after this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2024 10:47 AM
I just shared a portion of it.
This info will be integrated into another tool. So, we changed the requirement to address this in a different way in my flow.
Thanks for troubleshooting with me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 12:19 PM
Hi @Rajini2 ,
Please refer below thread:
Please hit like and mark my response as correct if that helps.
Regards,
Sumanth Meda