Get sys_id of attachment in ui action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 01:45 AM
Hi, I have a button on workbench.. I want to download the attachment of the record. it is not working. Button is on workspce.
function onClick(g_form) {
var sysID = g_form.getUniqueValue();
var gr = new GlideRecord("sys_attachment");
gr.addQuery('table_sys_id', sysID);
gr.query();
while (gr.next()) {
var attSysID = gr.sys_id;
}
alert(sysID);
var URL = '/sys_attachment.do?sys_id='+attSysID;
//window.open(URL, '_blank');
//action.setRedirectURL(URL);
//action.setReturnURL(current);
top.window.open(URL, 'blank');
}
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 02:13 AM
there is only one attachment.. I want to download it by button only