Book Image

Salesforce Lightning Cookbook

By : Syed Chand Shah
Book Image

Salesforce Lightning Cookbook

By: Syed Chand Shah

Overview of this book

<p><span id="description" class="sugar_field">The new Lightning Experience combines three major components—Lightning Design System, Lightning App Builder, and Lightning Components—to enable anyone to quickly and easily create beautiful, modern enterprise apps. If you wish to meet the challenges that Lightning throws at you head-on, then look no further because this practical book will be your faithful companion and ensure that you make best use of the Lightning platform.</span></p> <p><span class="sugar_field"><span id="description" class="sugar_field"> The book starts by walking you through the three major Lightning Components and helps you enable and configure a Lightning solution. You will explore the art of working with standard components and build a basic layout for the application. Then, you will add more advanced components using the Lightning Framework. Finally, you will also build and migrate reports and dashboards to make your app look more professional. Towards the end of the book, you’ll make use of Design System to work with Salesforce data and lay out the entire page with the components that you’ve built, before integrating Visualforce in your application.</span> </span></p>
Table of Contents (11 chapters)

Preparing users for Lightning Experience


In this recipe, we are going to take a look at deciding who can use Lightning Experience, how custom profiles are going to be used to get work done, how custom permission sets are going to be used, and how to handle a System Admin, as well as the other standard profiles, using these custom profiles and custom permission sets. We have already understood that all these standard profile users are automatically enabled with Lightning Experience. Let's understand each one in detail. Lightning Experience is not to be given to just one user. We have to understand that we already had another user enabled with Lightning Experience.

How to do it…

  1. Let's use the System Admin user in Chrome, and there is the Sample User in another browser, or an incognito tab in the same browser. If you are using the Lightning Experience, you will see App Launcher. We need to make a custom profile by disabling the Lightning Experience User option.
  2. You are in the System Adminnow. Let's go to either Classic or Lightning Experience. Here, we have selected Lightning Experience:

 

  1. In order to do our job, we need to go to the Setup icon. Click on Setup and a new window will open. From here, you can find profiles, or you can go to ADMINISTRATION | Users | Profiles. You will find all the profiles here, and you can clone any of the standard profiles:
  1. Select Salesforce User licenses standard user cloning, and provide a name; a custom profile is ready available:
  1. If you scroll down, under Administrative Permissions you will find the custom profile where we have deselected the Lightning Experience User.
  1. Let's test the Sample User; you can see that this Sample User is in Salesforce Classic. If a specific user or specific users have to be given Lightning Experience, create a permission set. In System Admin, under the ADMINISTRATION setup, there is Permission Sets. Try to create a new permission set.
  2. Permission set comes under System | System Permissions and enables Lightning Experience User saving:

The permission set has to be assigned to the user, using the Manage Assignments button. Before that, we will check theSample User. There is no switcher, and they are not in Salesforce Lightning Experience. So, let's assign permissions to the Sample User. Then, once you have done that, let's check it in the Sample User window. The first thing to do is to reload/refresh the window.

Note

The best practice is to log out, and then log in. If you do not get the result, log out, and then log in; that's it.

Now, this user has been granted Lightning Experience and a switch to move to Salesforce Classic (Switch to Salesforce Classic) too. All users can be given that profile and you can simply have a custom profile now that a permission set is not needed either. With permission set, a few users are given. If you want to give all users that profile, simply go to that profile and enable the option, that's all there is to it.

The profile has already been assigned to the user, and they have got Lightning Experience with that profile. System administrators need to use the Lightning report builder; a permission set is included for this too. By default, standard user profiles that use the Lightning Experience report builder are not enabled. Simply have a permission set, enable the option Lightning Console User, and assign that required permission set to that user:

We will see this once again when we deal with Lightning Experience reports and dashboards.

  1. Once again, create a new permission set, go to Permission Sets | New and provide a name, then go to Report Builder (Lightning Experience), and click Save. When we discuss Lightning reports and dashboards, we will look at an example of a standard profile, how to handle system administrators, as well as the standard profile users to give that enhanced report builder.

How it works…

Now, as you can see, System Admin has got the Switch to Salesforce Classic switcher. This should not be there; it should only be in Salesforce Lightning. We will go to the profile that has been assigned to these users. You have one option, Hide Option to Switch to Salesforce Classic. Because this was disabled, theSystem Adminis able to see that switcher. We will now not enable it, so that they don't see the Switch to Salesforce Classic option:

After doing that, click on Save. This custom property is already assigned to the System Admin user, and we will see the effect now. Now, if the System Admin reloads the page, there will not be a Switch to Salesforce Classic link on the username button (System Admin). We have now gone through all the examples. In the next recipe, we will look at the rollout plan.