Skip to content

Instantly share code, notes, and snippets.

@escgeek
Created February 13, 2018 20:45
Show Gist options
  • Save escgeek/5dcf9a24e37ad70218e07a4c7af8e08e to your computer and use it in GitHub Desktop.
Save escgeek/5dcf9a24e37ad70218e07a4c7af8e08e to your computer and use it in GitHub Desktop.
Easy solution to create a printable record page in Salesforce Lightning (Spring 18)
<apex:page standardController="Complaint__c" sidebar="false" title="{!Complaint__c.Name}" showHeader="false">
<apex:form >
<br/>&nbsp;&nbsp;&nbsp;
<!--<br/><u><a href="/{!Complaint__c.Id}">Return to {!Complaint__c.Name}</a></u>&nbsp;-&nbsp;
<apex:commandLink value="Click for Printable View" onclick="window.print();"/> -->
<apex:commandbutton value="<-- Click to Return to {!Complaint__c.Name}" action="/{!Complaint__c.Id}" />&nbsp;&nbsp;&nbsp;
<apex:commandButton onclick="window.print();" value="Print Compliant" />
<apex:detail subject="{!Complaint__c.Id}" relatedList="false" title="false"/>
</apex:form>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment