How to replicate the functionality of the 'Download All' button!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 02:08 PM
Recently one of my customers wanted to replicate the functionality of the 'Download All' button available via the attachment paperclip. But the request was to add the related list sys_attachment to the application form and provide the user with a List Banner Button UI Action called 'download all attachments (zip)'. To achieve this I got access to the OOB UI action and manipulated it to achieve the requested functionality. I am sharing this with everyone because I was not able to find this solution anywhere and I do not want anyone to waste their time trying to figure this out.
Name: download all attachments (zip)
Table: sys_attachment
Active: true
Show update: true
Client: true
List banner button: true
Onclick: downloadAllAttachments()
function downloadAllAttachments() {
//below is the OOB code that can be used for a regular UI action if you need
//var downloadUrl = window.location.protocol + '//' + window.location.host + '/download_all_attachments.do?sysparm_sys_id=' + g_form.getUniqueValue() + "&sysparm_this_url=" + g_form.getTableName();
//below is the customized code that is needed to be added if you want to use this for a related list
var downloadUrl = top.location.protocol + "//" + top.location.host + "/download_all_attachments.do?sysparm_sys_id=" + g_form.getUniqueValue() + "&sysparm_this_url=" + g_form.getTableName();
//below is needed for the regular UI action
//window.location = downloadUrl;
//below is needed for the List banner UI action
top.location.href = downloadUrl;
}
- 2,358 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 04:47 AM
Hello Austin,
Can we add the download all attachment in service operation workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 02:58 AM
Hi @mahesh143 , I've just tried it and it works in SOW.
You have to configure a related list action with following configuration and the code suggested by @austinbuono and it works for me:
Hope that helps!
Joaquín
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 06:00 AM
Hi Joaquin,
Can we add this Download All Attachment functionality to new Configurable HR Workspace 'Agent Workspace for HR Case Management'? I tried implementing the same, but it didn't work for me.