This widget could not be displayed.
This widget could not be displayed.

attachment should open in new tab when opened from activity tab

gtgauravtya
Tera Contributor

When I click on Attachment from Workspace Activity tab , it opens in same tab and I am not able to see Case details.

Requirement - when I click on attachment , it should open in new Tab.

gtgauravtya_0-1720164491103.png

5 REPLIES 5

Yashsvi
Kilo Sage

Hi @gtgauravtya,

please check below link:

https://www.servicenow.com/community/developer-forum/show-attachment-in-new-window/m-p/2113687

Thank you, please make helpful if you accept the solution.

This solution won't work for workspace.

moeiz
Tera Contributor

Hi Yvonne007, 
Did you find any solution for this issue? Let me know if you did.

yvonne007
Tera Contributor

Hey there, yes I found a solution here (although I had to work out the detail).

https://www.servicenow.com/community/next-experience-forum/how-to-preview-attachment-in-the-new-tab-...

In the navigation menu, type 'Now Experience Framework -> Declarative Actions -> Create New Action.

Type -> Attachment
Action label -> View
Action name -> view
Implemented as -> UXF Client Action
Specify Client Action (create a new record)
Key -> NAV_ITEM_SELECTED
Label -> NAV_ITEM_SELECTED
Applicable to -> Attachment

Payload ->

 

{
    "external": {
        "url": "/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id={{attachmentSysId}}"
    }
}

 

Tooltip -> Preview in new window

Then this system property needs to be created: "com.snc.documentviewer.enable_document_viewer" with a default value of true.

 

In the navigation menu, System Definition -> Dictionary.

Search for the 'incident' table, with a 'type' of collection
In the Attribute related list, add a new entry for 'Use Document Viewer', with a Value of true.

Repeat for Change, Problem and the related child task tables.