Stop redirect from UI Macro when Document download link is clicked

chadp
Mega Contributor

Hi Community!

Have an issue with a UI macro for downloading a SOP document from a knowledge base article.  

When I preview the record producer myself the download works correctly but the record producer preview window redirects to the homepage url.

When I impersonate a Customer user who would be accessing this SOP document , the below screenshots show, the redirect happens again but completely freezes the instance. and also it does not download.

Can anyone advise on the redirect issue and the download not working for the Customer user?

Screenshot 1: User clicks the SOP document link

find_real_file.png

Screenshot 2:   UI Macro does not Download document and redirects to frozen duplicate homepage screens

find_real_file.png

1 ACCEPTED SOLUTION

Gurpreet07
Mega Sage

It seems like again you are using a deep link and its   opening frame inside a frame. There shouldn't be 'nav_to.do?uri=' in the link. Remove bold part from below link.


"https://test.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=5ae18a3c37abb200a1e9466754990e00"


If the attachment is on same instance then you could also use a relative link


"/sys_attachment.do?sys_id=5ae18a3c37abb200a1e9466754990e00"


After all the user should have access over attachment.


View solution in original post

8 REPLIES 8

Gurpreet07
Mega Sage

It seems like the customer do not have access over attachment. This should be something to do with the ACLs on sys_attachment table. OOTB access is granted to user if he's having read access to the record to which attachment belongs to or attachment do not belong to any table.


You could remove target="_blank" from the link and it will not open new tab.


chadp
Mega Contributor

Unfortunately, I have hit another snag, it appears our Knowledge Base in Test is being domained for use in prod when those testing cycles are complete.




In light of that I have created the KB article again in the specific Customer domain that the user I am impersonating is in and then trying to access the SOP document with the new link in the Macro   I created.



Now I have the duplicate panes issue for both myself and the User. However I can still download it but it freezes me with the duplicate pane screens.



find_real_file.png


Gurpreet07
Mega Sage

It seems like again you are using a deep link and its   opening frame inside a frame. There shouldn't be 'nav_to.do?uri=' in the link. Remove bold part from below link.


"https://test.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=5ae18a3c37abb200a1e9466754990e00"


If the attachment is on same instance then you could also use a relative link


"/sys_attachment.do?sys_id=5ae18a3c37abb200a1e9466754990e00"


After all the user should have access over attachment.


chadp
Mega Contributor

Gupreet.



You advice in this entire thread led to a wonderful success!



thanks!   I know how to manipulate our macro urls now.



Appreciate he help!