In Chapter 3, we studied the Salesforce sharing architecture, including OWD and role hierarchies. We saw how different real-world problems can be solved by using various sharing mechanisms. Last, we looked at how profiles and permission sets play a key role in handling object- and field-level security in Salesforce.
This chapter is divided into three sections: taking a deep dive into Lightning Experience; creating dynamic Lightning pages; and enabling custom buttons, links, and actions.
A Deep Dive into Lightning Experience
Unlike Salesforce Classic, the engine behind Lightning Experience is a user’s device agnostic. What does that mean? Well, mobile use has been increasing exponentially—be it at the workplace or for personal use. Sales reps are now using mobile devices to find potential customers, use social media to connect with customers, and more. Lightning Experience mimics the way sales reps work on a mobile platform and thus provides a seamless experience across platforms.
Lightning Experience is a fresh and productive user interface. It is aimed at helping sales reps close more deals quickly by providing flexible, intuitive, and interactive tools. The tools enable the reps to focus on deals, customers, and activities that promise the greatest returns. The sophisticated Lightning Experience user interface, coupled with Einstein’s predictive modeling, turbocharge sales rep productivity exponentially by enabling them to take the step at the right time, with the right customer, on the right deal.
In addition to being faster, Lightning Experience enables system administrators to deliver a pleasant user experience by quickly building a Lighting page to suit a user’s working style or needs. Lightning Experience uses a component-based design pattern. This means, to build a Lightning page, all you have to do is place components onto a page at the location of your choice! Let’s go ahead and see what Lightning Experience looks like.
The Lightning Experience Navigation Menu
Switch apps via App Launcher.
Identify the current app’s name.
Access recent records.
Create new records.
Standard objects
Custom objects
Home tab
Visualforce tabs
Lightning component tabs
Web tabs
Canvas apps via Visualforce tabs
The App Launcher in Lightning Experience
The app menu lists all apps installed in the org. However, the apps users see in App Launcher and in the app menu may vary based on visibility settings and user permissions set on their profile.
The Home Page
Furthermore, unlike Classic, with Lightning Experience, users can remove the Home tab from a Lightning app. A Home tab is no longer mandatory!
Global Search
What happens if users have tons of records in Salesforce? How can they get what they need quickly? Well, global search is there to rescue these users!
If users click the global search box from an object-specific view, like from a Leads page, then, the global search looks for leads based on the search string.
Creating Dynamic Lightning Pages
The beauty of Salesforce’s Lightning Experience is that it allows users to create dynamic pages without writing a single line of code. Such features deliver a high level of sophistication and customization in Lightning Experience that is missing from Classic.
Controlling Component Visibility
Now he wants to learn how to make the Files component dynamic on the Leads record page based on the logged-in user. Specifically, he wants to hide the Files component from the system administrator.
- 1.He navigates to Setup (gear icon) ➤ Setup ➤ Object Manager ➤ Lead ➤ Lightning Record Pages and locates the Lead record page (Figure 4-8).
- 2.
Robin clicks Edit and navigates to Lightning App Builder.
- 3.
- 4.This action redirects Robin to a new window, where he selects the filter type, field, operator, and value as follows:
- a.
For Filter Type, she selects Advanced.
- b.
For Field, he selects Profile Name by navigating to User ➤ Profile ➤ Name.
- c.
For Operator, he selects Not Equal.
- d.
For Value, he selects System Administrator.
- a.
- 5.In the end, Robin’s screen looks look the one in Figure 4-10.
- 6.
He clicks the Done button.
- 7.
After completing all configurations, he saves the Lightning page by clicking the Save button.
When Robin clicks the Save button, Salesforce recalculates the sharing settings of the components added to the Lead Lightning record page and removes Files component access from a system administrator. This may be an eye opener! It is important to know and understand that even a system administrator is not immune from not having visibility access to a component. Powerful indeed!
Likewise, users can control visibility of components on the Lightning record page, app page, home page, and Lightning for Outlook page.
Lightning Page Assignment
Assign a page as an org default.
Assign a page as the default for specific Lightning apps. For instance, users can have multiple Lead lightning pages based on different Lightning apps. Users can assign Lead record pages (Sales) to the Lightning Sales app. Similarly, they can assign Lead record pages (Service) to the Lightning Service app.
Use a combination of app, record type, and profile.
Robin has now become a pro in creating Lightning record pages and knows how to show and hide components from them. He created a Lightning record page for Lead called Lead Record Page (Sales). Next he wants to assign this record page to the Sales app so that whenever users open the Lightning Sales app, they see this page for the Lead record. Robin performs the following steps to meet this requirement using the page visibility setting:
- 1.
He navigates to Setup (gear icon) ➤ Setup ➤ Object Manager ➤ Lead ➤ Lightning Record Pages and then locates Lead Record Page (Sales).
- 2.
Robin clicks Edit and navigates to Lightning App Builder.
- 3.
To add component visibility, he clicks the Activation button at the right-hand top corner. The system redirects Robin to a new window to set up the Lightning page assignment.
- 4.Robin clicks the APP DEFAULT tab and then the Assign as App Default button to set the Lightning page for the Lighting Sales app, as shown in Figure 4-11.
- 5.
Then he selects the app: Sales.
- 6.Robin clicks the Next button, as shown in Figure 4-12.
- 7.He then reviews the assignment and clicks the Save button, as shown in Figure 4-13.
After Robin clicks the Save button, Salesforce recalculates the sharing settings and page assignment for the Lead object. Going forward, users will see the Lead Record Page (Sales) when they select the Lightning Sales app and open the Lead record.
Use Case for Custom Buttons and Links
Each business unit has its own set of requirements that may require specific configuration. For example, if users are responsible for managing vendors and they want to allow access to an Account page from outside the org (e.g., for a vendor management system), then Salesforce requires users to create a custom button or a link.
A custom button or a link allows users to integrate Salesforce data from external applications or data from a company’s internal portal, for example. The ability to access Salesforce data from an external application—with a click of a button or a link—boosts user productivity several-fold.
List button: Appears in a related list of an object’s record page.
Detail page link: Appears in the Links section of the details page of an object’s record.
Detail page button: Appears in the action menu in the highlight panel of an object’s record page.
Let’s rejoin Robin, who has just received a requirement to create a custom button on a Lead page to search a lead company using Google search. After clicking the button, it should open a Google search page and find details about the lead company.
- 1.
He navigates to Setup (gear icon) ➤ Setup ➤ Object Manager ➤ Lead ➤ Buttons, Links and Actions.
- 2.Robin clicks New Button or Link, which redirects him to a new window to set up a custom button. Once there, he works his way through by entering information as follows:
- a.
Label: Robin names her custom button Open Google Search.
- b.
Name: This field autopopulates based on the label.
- c.
Description: Robin writes some meaningful text so that other developers and administrators can understand easily why the custom button was created in the first place.
- d.
Display Type: He selects Detail Page Button.
- e.
Behavior: He selects Display in existing window without sidebar.
- f.
Content Source: He selects URL, then pastes the following URL into the large text box: https://www.google.com/search?q={!Lead.Company}.
In the end, Robin’s screen looks like the one depicted in Figure 4-14. - a.
- 3.
Robin clicks the Save button.
- 4.
Next, he adds a new custom button to the Lead page layout by navigating to Setup (gear icon) ➤ Setup ➤ Object Manager ➤ Lead ➤ Page layouts.
- 5.Then he clicks the Edit link and drags and drops the custom button Open Google Search to the Salesforce Mobile and Lightning Experience Actions section of the page layout, as shown in Figure 4-15.
- 6.
Robin clicks the Save button.
- 7.
He makes sure to whitelist the https://www.goggle.com URL.
Likewise, users can add a custom link to an Account’s record page to make an account manager’s life easier. Furthermore, they can also add Sales guideline pdf custom links to the Opportunity record page to improve a team’s productivity.
Use Case for Custom Actions
- 1.Object-specific actions: Object-specific actions have automatic relationships to other records. The actions let users quickly create or update records, send e-mail, log calls, call Lightning components, execute Lightning Flow, and call a Visualforce page in the context of a particular object. A few examples of object-specific actions include the following:
- a.Creating a custom action on Opportunity object to update Stage to Closed Lost, as shown in Figure 4-17.
- b.
Creating a Record Create action (Create Order) from Opportunity without leaving the Opportunity record page.
- a.
- 2.
Global actions: Users can create global actions in Setup, then put global actions anywhere on an object that supports actions. Using global actions, users can log calls, create records, send e-mail, call a Visualforce page, execute a Lightning component, and call Custom Canvas all without leaving the page.
In Chapter 6, we see how to use custom actions to call Lightning Flow.
Points to Remember
Users can’t personalize the navigation bar when it contains more than 50 items.
When a system administrator removes an item from an app, that item remains in users’ personalized navigation bars. Then, if they so choose, users can delete the item.
Lightning apps aren’t available in Classic.
The object-specific Send Email action is only available on cases.
To show custom buttons, links, or actions in Lightning Experience, you must customize the Action section of a page layout. If you do not, then you will see whichever default buttons, actions, and links are defined by Salesforce.
Hands-on Exercises
- 1.
Edit a Lightning record page of a Lead object and explore different components. Test out its role and functionality.
- 2.
Create a custom button to open a Yahoo News page for Account.
- 3.Dennis Williams, a system administrator at GoC, has received the following requirements:
On an Account Lightning record page, hide the News component from those users that do not have Access Activities permission.
How would you instruct Dennis to perform this task?
- 4.
Dennis Williams has new requirements: create a quick action on the Lead object to update Status quickly to Unqualified, then add the quick action to all Lead record pages. How would you instruct Dennis to perform these tasks?
- 5.Create a custom Lightning app (named Sales Critical) and add the following tabs to it:
Home
Lead
Account
Contact
Opportunity
Campaign
Then, list all your new findings, including app logo size, navigation style, and app personalization settings, and add a Utility Item section.
Summary
In this chapter, we looked at an overview of Lightning Experience, followed by an in-depth study of the dynamic record pages. We also examined custom buttons, links, and actions use cases with real-life examples. In Chapter 5, we take at deep dive into how to improve and enrich data quality in Salesforce.