Get Label From SObject API Name
Sample Code:
String objectLabel = SObjectType.YourObjectApiName__c.getLabel(); System.debug(objectLabel);
Sample Code:
String objectLabel = SObjectType.YourObjectApiName__c.getLabel(); System.debug(objectLabel);
We can use UserInfo.UITheme() and UserInfo.UIThemeDisplayed() in Apex class to determine User Experience Theme.
UserInfo.UITheme() : Returns the theme that is supposed to be used.
UserInfo.UIThemeDisplayed() : Returns the theme that is actually being used.
UserInfo.UITheme() and UserInfo.UIThemeDisplayed() will return following values.
Sample Code:
String themeDisplayedType = UserInfo.getUIThemeDisplayed(); String themeType = UserInfo.getUITheme();
We can use User.UITheme and User.UIThemeDisplayed in Visualforce Page to determine User Experience Theme.
User.UITheme : Returns the theme that is supposed to be used.
User.UIThemeDisplayed : Returns the theme that is actually being used.
User.UITheme and User.UIThemeDisplayed will return following values.
Sample Code:
<apex:page> <apex:pageBlock title="Theme"> {!$User.UITheme} {!$User.UIThemeDisplayed} </apex:pageBlock> </apex:page>
renderAs="advanced_pdf"
in the apex:page
tag of a Visualforce page with API version 40.0 or later.Example:
<apex:page readOnly="true" standardController="Account" applyHtmlTag="false" sidebar="false" showHeader="false" cache="true" renderAs="advanced_pdf" docType="html-5.0"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style type="text/css"> @page { size: A4 landscape; border: 1px solid black; padding-left: 5px; padding-right: 5px; } th { font-weight: bold; text-align: center; background-color: #92d5f0; color: black; padding: 8px; } td { font-size: 15px; text-align: left; padding: 8px; } table{ border-collapse: collapse; } table, th, td { border: 1px solid black; } </style> </head> <center> <h3>{!Account.Name}</h3> </center> <table width="100%"> <tr> <th>Name</th> <th>Phone</th> <th>Email</th> </tr> <apex:repeat value="{!Account.Contacts}" var="con"> <tr> <td>{!con.Name}</td> <td>{!con.Phone}</td> <td>{!con.Email}</td> </tr> </apex:repeat> </table> </apex:page>