Download Attachment upon clicking an UI action in Workspace.

Swathi P
Tera Guru

Hi All,

 

I have an UI action called Download Template in scoped application which downloads the attachment into system . I am trying to create a workspace View for the table and added the button in Form actions and added Workspace script . Upon clicking the Download Template button in workspace. It is redirecting to Picture 2 rather than downloading the attachment. IIt is working fine in UI 16 View Not working proper in Workspace. How to correct this . Please help.

 

Picture1:

find_real_file.png

Picture 2:

find_real_file.png

Thanks & Regards

Swathi Padighar

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

for the UI action to work in workspace you should write code in workspace client script

share your complete script and UI action configuration screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Yes .The script is written in workspace client script . Action name of the UI action( Picture 1). and under UI action script  action.setRedirectURL(url) is written .

 

Picture 1: 

find_real_file.png

 

Hi,

you didn't share the complete script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi ,

 

It is redirecting to attachment  URL in UI action script . This is the script.

var URL = '/sys_attachment.do?sys_id=' + attachmentSysID ;

action.setRedirectURL(url);
action.setReturnURL(current);