- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 08:26 AM
Hi all,
How can I improve the following script to open my attachment and display file on my screen
var attachment = new GlideSysAttachment();
var agr = attachment.getAttachments('incident', 'e8caedcbc0a80164017df472f39eaed1');
while(agr.next())
gs.info(agr.getValue('file_name'));
Thanks in advance,
Carole
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 08:46 AM
Where did you writing this script?
Recently, I have achieved this requirement in one of the form using UI Action. Please find below logic it may help you and it will open the attachment in new tab.
var ins = 'https://<INSTANCE NAME>.service-now.com/';
url = ins + 'sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=' + "ATTACHMENT SYS_ID";
g_navigation.openPopup(url);
Before doing this you must activate the below property:
com.snc.documentviewer.enable_document_viewer
If not present, create new property with the above name and set value as "true"
Hope it helps..
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 08:46 AM
Where did you writing this script?
Recently, I have achieved this requirement in one of the form using UI Action. Please find below logic it may help you and it will open the attachment in new tab.
var ins = 'https://<INSTANCE NAME>.service-now.com/';
url = ins + 'sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=' + "ATTACHMENT SYS_ID";
g_navigation.openPopup(url);
Before doing this you must activate the below property:
com.snc.documentviewer.enable_document_viewer
If not present, create new property with the above name and set value as "true"
Hope it helps..
Murthy