- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 09:25 AM
Hi,
I have created the workspace UI action form button. I want to download the attachment from the URL when the user clicks on it but then return to the same workspace form. It is downloading the attachment but then it keeps on loading instead of staying in the same form.
function onClick(g_form) {
var redirectURL='/nav_to.do?uri=sys_attachment.do?sys_id=eb8b1a6f8714e21044e031983cbb35b4';
//top.window.location = redirectURL;
var win = top.window.open(redirectURL, '_blank');
win.focus();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 07:11 AM
try this
Also did you check in different browsers? is auto download enabled in browser?
function onClick(g_form) {
var redirectURL='/sys_attachment.do?sys_id=eb8b1a6f8714e21044e031983cbb35b4';
//top.window.location = redirectURL;
open(redirectURL, '_self');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 07:09 AM
Hi @Ankur Bawiskar ,
Yes it is just an file with 2 rows of records and has only 10kb size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 07:11 AM
try this
Also did you check in different browsers? is auto download enabled in browser?
function onClick(g_form) {
var redirectURL='/sys_attachment.do?sys_id=eb8b1a6f8714e21044e031983cbb35b4';
//top.window.location = redirectURL;
open(redirectURL, '_self');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 02:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 03:00 AM
Glad to help.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader