The New Lightning Security Report

June 13, 2021

The Lightning Experience brings modern web technologies into the Salesforce user interface. You can override many aspects of the Lightning Experience with Visualforce Pages, Lightning Components, and Flexipages. There are multiple levels of override, so the Lightning Experience can be customized extensively. But all of these customizations can be difficult to keep track of. For example, when a particular User clicks on a certain Object, what Page will be Viewed? These customizations are also notoriously difficult to deploy between Orgs. To address these issues, Snapshot has introduced a new Lightning Security Report with Smart Deploy. This report will give you an overview of all Lightning customizations, allow you to quickly edit these customizations, and then easily deploy the changes to your Org.

Visualforce Pages in Salesforce Classic

In the classic version of Salesforce, Visualforce Pages (Apex Pages) could be used to override various Actions in the user interface. The picture below shows the Account object in the Setup Menu. As you can see, the Edit and View Actions have been overridden. These Action Overrides are stored in the Custom Object.


Introducing Lightning Components

Later on, Salesforce extended the Custom Object Action Override to also include Lightning Components (Aura Bundles). The View, Tab, New, and Edit Actions can be overridden with Lightning Components. Lightning Components are used in small form factors like Mobile Phones or large form factors like the Desktop Experience. If you do not specify a Lightning Component, then the Mobile and Desktop Lightning interface will use the classic Visualforce Page.


Here Come Flexipages

When the Lightning Experience was introduced, Salesforce need a responsive replacement for the classic Page Layout. Flexipages are the new solution for customizing Lightning Experience pages. You can launch a Flexipage Tab Action when the user clicks on the Home Page for any application. Flexipages can also be launched for the View Action when a particular Record is displayed. You can specify different Flexipages for each Custom Application, Record Type, and Profile combination. Because of this, the Action Override information for Flexipages is stored in the Custom Application.

Let’s look at the Tab Action first. The Tab Action controls what Page is displayed when a particular User clicks on the Home Tab. The default option for the Home Page is the Custom Tab called standard-home. A Flexipage of type HomePage can be assigned to override this tab. The Flexipage can be assigned as the Org Default, an Application Default, or as a combination of Application and Profile. The Activation Dialog below in Lightning App Builder shows the assignment options. Note that Org Default can be overridden by App Default which can be overridden by App and Profile.

All of this pertains to overriding the Home Page Tab. If you want to override a Custom Object Tab, then you can do that by editing the Tab Action for the given Custom Object. This is a bit confusing, because there are two different Tabs involved. The Home Page Tab is associated with the Custom Application, and the Custom Object Tab is associated with the Custom Object.

Now let’s take a look at the View Action. The View Action controls what screen is displayed when a particular User attempts to view an Object. A Flexipage of type RecordPage can be assigned as the Org Default, an Application Default, or as a combination of Application, Record Type, and Profile. The Activation Dialog below in Lightning App Builder shows the assignment options. Note that Org Default can be overridden by App Default which can be overridden by App, Record Type, and Profile.

The Org Default Flexipage will override any Visualforce Page or Lightning Page that is currently defined for the View Action. The App Default will override this Flexipage for a specific Custom Application. The App, Record Type, and Profile combination will override all other Pages when the Object is Viewed.

Overwhelming Overrides

While Lightning Experience provides great customization options, managing this complexity is mind bending. For example, when a particular User clicks on a certain Object, what Page will be Viewed? In order to answer this question, you would need to understand the five levels of overrides that are involved:

  • Classic Visualforce Page
  • Lightning Component
  • Org Default Flexipage
  • Application Default Flexipage
  • Application, Record Type, and Profile Flexipage

Detail View

The new Lightning Security Report clarifies this confusing situation. The detail view displays all of your action overrides on a single page. The reports are divided by Form Factor:

  • All (Large and Small)
  • Lightning Desktop (Large)
  • Mobile Phone (Small)

The report shows the Override Type sorted by order of appearance in the user interface. The Override Source column shows the name of the Metadata Asset that contains the override information. This is useful when these assets are deployed. The Content Type and Content Source show the actual Visualforce Page, Lightning Page, or Flexipage that will be seen in the user interface. The Record Type column shows the associated Record Type if any. Sometimes this column just has a Custom Object name for the App Default override. When there is a Tab Action, this column has the Tab name standard-home. The Profile Name column shows the Profile Name. The last column has the Action Name and Form Factor. Right click the table to toggle the visibility of various characteristics. You can Show Labels to include all the various labels in the report.

The report is color coded by the type of object that contains the override information. This also relates to the type of override. Here is a legend for reading the report:

  • White – Custom Tab – Org Default
  • Green – Custom Object – Page Component
  • Yellow – Custom Application – Application Default
  • Red – Custom Application – App, Record Type, and Profile

Summary View

The last part of the report list provides summary tables for the View Action and Tab Action by Form Factor. The Minimum, Medium, and Maximum options control the amount of information in the table. There is no Tab Action for the Small Form Factor, so that option is not included. The summary report gives you a three-dimensional view with Custom Applications and Profiles down the left and Record Types across the top. This provides all of the information about what View will actually be displayed when a particular User clicks on any Object. There are catch-all areas for Other Profiles and Other Applications that are not explicitly controlled by an override.

Summary Tab

The last part of the report list shows a summary view of all the Tab Actions. As mentioned earlier, there are two kinds of Tab Actions. The Home Page Tab Actions occupy one column of the report. They depend on the Custom Application and Profile settings. The other columns will show the Tab Action for particular Custom Objects. This is controlled by the Visualforce Page, Lightning Page, or Flexipage that has been assigned to the Custom Object. This information does not depend on Custom Application or Profile.

Editing Assignments

At the upper left of the Lightning Security Report there is a button to hide and show the Editing Palette. When the Palette is visible, you can select cells from the report table. The Palette allows you to Add, Edit, Duplicate or Remove the selected assignment. This will launch the Assignment Dialog, shown below:

You can edit all of the different characteristics from the selected action override and create new overrides of any type. When some menu items are selected, other menu items will change to make sure that your action override will validate when deployed. When you are done editing, click the OK button and return to the main report interface. Now you will see the Deploy button, available below:

Click the Deploy button to launch the Smart Deploy interface. This interface will show the Metadata Assets that you have changed in the Create Job List. These assets might include Custom Tabs, Custom Objects, and Custom Applications. You can make any changes that are needed to the Create Job List or other deployment parameters. The last tab of the Smart Deploy interface allows you to Deploy these changes to the destination org.

Smart Deployment

Action overrides can be difficult to deploy between orgs. There can be hundreds of action overrides stored in a single Custom Application. When you deploy the Custom Application, all of the action overrides on the destination are overwritten. Unlike Profiles, Custom Applications do not have child types. The new Smart Deploy interface in the Lightning Security Report makes the deployment of action overrides much simpler. You can view the entire configuration of action overrides on a single screen, make changes quickly, and deploy the changes without leaving the report or editing XML.

Conclusion

The new Lightning Security Report is another great way to understand the complexity in your Salesforce org and make changes when needed. Keep reducing that technical debt and your org will be more agile than ever! Let us know how the Lightning Security Report is working for you.

Bill Appleton
CTO Metazoa

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *