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
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in 

Lightning Button is not working in salesforce1 app

We have a custom object Quote in that there is a lightning button called "Quote preview LE".where when we click on quote preview button it will open PDF. It is perfectly working on salesforce classic and lightning desktop and it is not working on the salesforce1 mobile app.

Generally, Lightning components should work on salesforce1app.I dont this is strange

This is our ID : 00D90000000bovq
Grant login access on your Org : yes


Component :
<aura:component implements="force:lightningQuickAction,force:hasRecordId" controller="Quote_Preview_LE">
    <style>
      .forceChatterLightComponent .bodyWrapper{height:0%;width:0%;padding:0;box-sizing:border-box}
      .slds-modal__close{height:0%;width:0;padding:0;display:none;}
     </style>
     <aura:attribute name="ProfileId" type="String"/>
     <aura:handler name="init" action="{!c.CheckPreview}" value="{!this}" />
    <aura:attribute name="quo" type="Quote__c" default="{'sobjectType': 'Quote__c'}" />
</aura:component>
controller :
({
    CheckPreview : function(component, event, helper){
            var qid=component.get("v.recordId");   
            //alert(qid);
            var action = component.get("c.getquoteid");
            action.setParams({ "recordId" : qid });          
            action.setCallback(this, function(a) {
            parent.location.href =parent.location.href; 
            window.open("/apex/QuotePreview?id="+qid,"_blank");    
        });
        $A.get("e.force:closeQuickAction").fire()
            $A.enqueueAction(action);
    }
})
quote preview  is a pdf page. It is opening in classic and lightning desktop.

I tried with the formulae field which is not working as well with a hyperlink URL

 
NagendraNagendra (Salesforce Developers) 
Hi Tejdeep,

This knowledge article Open a PDF with Salesforce for Android and iOS app https://help.salesforce.com/articleView?id=000268447&language=en_US&type=1 says:
Opening Dynamically Generated PDFs

If you're trying to dynamically build and display your PDF file, you will want to generate and save this file via your controller then navigate to the new ID accordingly. Generating and saving it on the server side, will eliminate conflicts noticed with the webview incorrectly handling content types across different platforms, or other rendering related issues that may occur. With this approach and navigating to the file directly, it should provide a more consistent user experience in our supported mobile environments.

NOTE: Salesforce Support cannot offer assistance in building out the functionality to dynamically generate PDFs, but we are able to assist if there is a specific error observed when attempting to render the dynamically generated PDFs.
plus using the e.force:navigateToSObject event to open the PDF.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra