Missing Printable view link in Lightning Experience detail page - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Adam JohnsonAdam Johnson 

Missing Printable view link in Lightning Experience detail page

Hi All,

I want to create a "Prinatble View" button on detail page for lightning  same as a salesforce classic but I am not able to got a solution ? Please help me on this , how I can do this?

Thanks
VIGNESH VIGNESH BALASUBRAMANIANVIGNESH VIGNESH BALASUBRAMANIAN
Hi Adam,

By default Printable View is not available in Lightning Experience,To have this option vote for the below idea..

https://success.salesforce.com/ideaView?id=0873A000000LmTMQA0

Thanks & Best Regards,
Vignesh.B
Infant RajaInfant Raja
Hi Adam,
          We can't use the button directly in lightning experience.So,we need to create VF page to use that View Button in lightning.Use the following one as a example.

 1.) Create a visual force page.  The only purpose of this page is to launch an APEX class controller that opens a URL.  
1<apex:page standardController="Opportunity" extensions="opportunityButton" action="{!autoRun}"> 
2<apex:sectionHeader title="Open Salesforce Opportunity and Pop Page"/>  
3<apex:outputPanel > You tried calling the an Apex Controller from a button.  If you see this page, something went wrong. Print this page and send the error to HDNotifier. 
4</apex:outputPanel>
5</apex:page>
2.) This is an example controller
01public class opportunityButton {
02    //Define the Project Object
03    Opportunity theOpportunity = new Opportunity();  
04    String theOpportunityID;
05    String theAccountID;
06    String theURL;
07     
08    // Constructor - this only really matters if the autoRun function doesn't work right    
09    public opportunityButton(ApexPages.StandardController stdController) {       
10        this.theOpportunity = (Opportunity)stdController.getRecord();    
11    }
12     
13    // Code invoked on page load.     
14    public PageReference autoRun()
15    {          
16        String thePageOpportunityId = ApexPages.currentPage().getParameters().get('id');
17        if (thePageOpportunityId == null)
18        {            
19            // Display the Visualforce page's error message if no Id is passed over            
20            return null;        
21        }      
22       
23    for (Opportunity theOpportunity:[select Id, Accountid from Opportunity where id=:thePageOpportunityId Limit 1])
24    {
25        theOpportunityID = theOpportunity.Id;
26        theAccountID = theOpportunity.Accountid;
27        TheURL = 'https://somewebsite.com/SFDC/SFDC_Portal.aspx?OPRNBR=' + theOpportunityID  + '&OPRTYP=1&OPRACCT='+ theAccountID;
28    } 
29       
30    
31    // Redirect the user to where ever you want to go.
32    PageReference pageRef = new PageReference(TheURL);        
33    pageRef.setRedirect(true);   
34    return pageRef;   
35    }
36}
3.) Create a new action on the opportunity.  Associate the visualforce page to the action.  

4.) Drag the Action into the appropriate area on the Opportunity page layout.  
 
Tom BlamireTom Blamire
Printable View isn't available in Lightning so you would need to either toggle back in Classic, Create a custom solution or use a 3rd Party app 
Adam JohnsonAdam Johnson
Hi Tom, 
Do you have any idea when salesforce will give this feathers in lightning? And please give name of some apps who are providing such functionality?

 
Tom BlamireTom Blamire
When it becomes available i couldnt honestly tell you. Apps that you could potential use would be Conga Merge
Adam JohnsonAdam Johnson
Hi Raja,

Which url should I use for my org?
"TheURL = 'https://somewebsite.com/SFDC/SFDC_Portal.aspx?OPRNBR=' + theOpportunityID  + '&OPRTYP=1&OPRACCT='+ theAccountID"

Thanks,
Tom BlamireTom Blamire
Hi Adam,

If any of the solutions have answered your question then could you mark a 'Best Answer' to close htis thread please?
Gad BouskilaGad Bouskila
Hello,

If this can help..
https://success.salesforce.com/ideaView?id=08730000000E0l0AAC
Amarjeet PuriAmarjeet Puri
Printable View Button working in Classic and Lightning as well for all object

<apex:page standardController="ServiceAppointment" showheader="false" sidebar="false">
<apex:form >
<apex:commandlink styleClass="cButtons" value="Print" reRender="dummy" onclick="printMyPartialPage();" rendered="true"/>
<apex:detail subject="{!ServiceAppointment.Id}" relatedList="false" title="false"/>
</apex:form>
<apex:includeScript value="https://code.jquery.com/jquery-2.2.0.min.js"/>
<Script>
function printMyPartialPage(){ $('.cButtons').hide();
window.print();
}
</script>
</apex:page>

ServiceAppointment is standard object.
Suzanne HartleySuzanne Hartley
I made a sledgehammer work-around with a little bit of Visualforce:

<apex:page standardController="Custom_Object__c">
    <apex:detail/>
</apex:page>

Launch with a QuickAction button. What pops up is a Classic view of the record page. You can click on the Printer button there to access the printable view.
bhavesh kumarbhavesh kumar
This functionality is now available for lightning as well. please check - https://success.salesforce.com/ideaView?id=0873A000000cQzLQAU
David RobertsDavid Roberts
Yes, 'Printable View' button is available and is standard on a custom list view. There is a limit of three buttons then further options are in the drop-down menu. I wanted my custom button to be clearly visible without having to go to the drop-down. I could only do this by removing standard buttons such as 'Printable View', 'Change Owner' and 'Import'.
Can I now create custom buttons that emulate those standard button that will then appear in the drop-down list?