function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sukhpreet Lotey 6Sukhpreet Lotey 6 

How to open an attachment URL within Salesforce1 app?


I am trying to create a UI design where a button click would open up a record's attached pdf file. Although I am able to do this using javascript as follows:
var attachmentUrl = '/servlet/servlet.FileDownload?file=00Q633030006G9k';
window.open(attachmentUrl)
but it opens as a downloadable file in mobile. I need to use the built-in salesforce preview to show this file. 
 
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
@Sukhpreet The feature shown is for lightning experience and not SF1 application.
Nirav Desai 24Nirav Desai 24
@Sukhpreet: Were you able to get this to wrok?