PRO TIPS
Enhance Record Pages with Dynamic Highlights and Conditional Formatting

 

The Salesforce Winter '25 release brought with it two great new features for making it easier to build dynamic Record Pages: the new Dynamic Highlights Panel and Conditional Formatting for fields. In this PRO Tips, we'll look at how to combine these features to build a responsive highlights panel on Account record pages that's easier to build and more capable than the legacy tools allowed for.

How it used to work

The Highlights panel is the section at the top of every record page in Lightning Experience; it shows up to five fields, along with standard action buttons like Edit and Delete. It can also display custom action buttons for Quick Actions you create. Here's a sample Highlights Panel from an Account Record Page:

The Highlight Panel from a Salesforce Account record, showing Account Name, Tier, Type, Phone number, Website, Owner, and Industry type fields, along with action buttons at the top right for Edit, Record a Reference, and Care Plan Update.

The biggest issue with the legacy Highlight Panel was that configuring it required making edits in a couple of different places in the Object Manager. To select the fields you wanted to display, you had to edit the object's Compact Layouts, and to edit the displayed action buttons you had to edit the full Page Layout.

There were other drawbacks as well. To make different fields or actions appear on different types of records, you had to build Record Types and assign different full and Compact Layouts to each record type. This added administrative overhead to build and maintain the extra layouts. It also required users to select a type every time they created a record.

Plus, the old Highlights Panel could only display five fields, which meant you had to do a lot of work to show only a little bit of data.

The Dynamic Highlights Panel changes all of this.

Enter the Dynamic Highlights Panel

Over time, Salesforce has enabled more ability to edit pages using the Lightning Editor. Dynamic Forms and Dynamic Actions make it easy to drag and drop items onto the page in the Lightning Editor. They also allow you to make fields and actions conditionally visibile, reacting to record criteria or user profiles.

The Dynamic Highlights Panel is the next step, combining functions of both to allow admins to remake the panel at the top of the page. Even better, the new panel can display up to twelve fields–more than double the old limit. You can also have multiple Dynamic Highlights Panels on a page and show them based on values on the record or user criteria (like profile).

To add the Dynamic Highlights Panel, you'll need to use the Lightning editor. The easiest way to do this for most system administrators is to visit a record page and click the gear icon at the top right, then select Edit Page.

A screenshot of Salesforce Lightning experience, showing an icon that looks like a gear highlighted in a red box. The user has clicked it, revealing a menu with an option for Edit Page near the bottom of the menu, which the user is hovering the mouse over.

Once the editor opens, click the Fields tab, and you'll see the Dynamic Highlights Panel option. Click and drag the component onto the page (usually it should go at the very top of the page).

A screenshot of the top left of a window showing the Lightning Editor. The Fields tab is selected and highlighted with a red box. Below it is a list of options. One of those is the Dynamic Highlights Panel, which is also highlighted with a red box.

Once you've added the Dynamic Highlight Panel, you can drag and drop other fields into it in the editor. Watch the video below for more ideas of what you can do with the editor.

There are a couple of extra things to keep in mind about Dynamic Highlights Panel:

  1. It only works on Lightning Web Component-enabled objects, which covers most, but not all, objects–a notable exception is Tasks.
  2. The panel will appear by default for Desktop users but must be enabled for Mobile users. You can find that setting in Setup->Salesforce Mobile App. Toggle on the setting for Dynamic Forms and Dynamic Highlights Panel on Mobile.

Adding Visual Cues with Conditional Formatting

Admins have long been asked to provide visual indicators on records like color-coded icons or stoplights to indicate status. For example, it might be desirable to mark prospective client accounts as having a red flag on them if they have no open Opportunities. Previously, doing this would have meant creating a custom formula field that handled the logic and displayed the appropriate icon–either an uploaded image or emoji. Now, Conditional Formatting promises to do the same without requiring the creation of a second field.

There are a couple of things you need to know about Conditional Formatting:

First: as of this writing in early November 2024, Conditional Formatting has not rolled out to all production orgs. Currently, the feature is available in pre-release orgs and preview sandboxes. So, you can start building, but it will be a bit of time before you can deploy to production.

Second: Conditional Formatting can only be applied to fields that are placed in a Dynamic Form or Dynamic Highlights Panel in the Lightning editor. If you are still using classic-style page layouts, you can't use Conditional Formatting–you must convert your page to Dynamic Forms first.

Knowing that, let's get started. To access the Conditional Formatting tools, you must use the Lightning editor. You can access it from any record page by clicking the gear icon at the top right of the window and selecting Edit Page.

In the Lightning Editor, clicking on a field will reveal the Conditional Formatting ruleset selector in the editor pane:

A screenshot of the Lightning editor, showing the user has click the Account Tier field in the Dynamic Highlights Panel. On the right hand pane, the Conditional Formatting ruleset selector is visible, with no value set.

Click in the box marked Select a ruleset... and click the Create Ruleset option that appears. Salesforce will apply the rule to change the formatting of the field you highlighted. All you'll need to do is give the ruleset a name and click Next:

The ruleset creation modal dialog box, showing that the only option for the user to enter is a name. Options that show it is linked to the Account Tier field on the Account object are pre-selected and not editable.

After you click Next, you can set up the first format and rule. First, select an icon and a color from the pickers. Right now, you can't select any icon or color, but there is an assortment that hopefully will grow over time. After making those selections, you'll need to specify a rule that causes them to be applied; in the example below we've specified that the icon should be shown if the Account Tier field equals Tier 5:

A screenshot of the Conditional Formatting rule creator. The user has selected the Happy Face icon from the Icon drop-down menu, and green from the color selector. At the bottom of the page, in the rule editor, the rule specified is that the Account Tier field on the record must equal Tier 5 Other.

After clicking Next, you'll see a summary of all the rules and can add additional ones. For instance, you could display a different icon or color for a different tier value. Each ruleset can have up to ten rules. Salesforce helpfully notes that it will process rules in the order in which they appear in the list. Once one rule has been satisfied, it will skip all the others:

Unfortunately, there is currently no way to change the order of rules–so be sure to save yourself some effort by building them in the "right" order (e.g. for numeric fields, you might want to build from the highest value to the lowest). That's a quick overview of using Conditional Formatting–see below for a slightly deeper-dive video.