How to download attachment(sys_attachment) in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2024 12:30 AM
Hi developer,
I added "Attachment" related list on catalog task record so that user can download files.
When I click on the File name on the Platform UI form file is downloaded, but on the Workspace UI form file cannot be downloaded and open the sys_attachment record.
How can I download attachment(sys_attachment) on Workspace UI?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2024 09:42 AM
Hi developer,
To enable downloading attachments directly from the Workspace UI, you can customize the behavior using a Client Script or UI Action.
Create a UI Action:
- Navigate to System Definition > UI Actions.
- Click New to create a new UI Action.
- Configure the UI Action to download the attachment.
Script for UI Action:
- Use the following script to handle the download:
function downloadAttachment(attachmentSysId) { var ga = new GlideAjax('AttachmentAjax'); ga.addParam('sys_id', attachmentSysId); ga.getXMLAnswer(function(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); window.location = answer; }); }
Add UI Action to Workspace:
- Ensure the UI Action is available in the Workspace by adding it to the appropriate form or list layout.
This approach allows users to download attachments directly from the Workspace UI without navigating to the sys_attachment record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2025 04:24 AM
Thanks ChatGPT..