Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

Customize Dynamic Related Lists

Learning Objectives

After completing this unit, you’ll be able to:

  • Customize a dynamic related list in Lightning App Builder.
  • Filter a dynamic related list to show only the records your users need.
  • Describe how dynamic related lists can make your pages more useful for your users.

You've learned what dynamic related lists are and how to create one. Now let's focus on some other useful ways you can customize dynamic related lists.

  1. If you’re not already on the Account Record Page in the Lightning App Builder, from Setup, enter App Builder in the Quick Find box, then select Lightning App Builder.
  2. Click Edit next to Account Record Page.
  3. In the Related tab on the canvas, click the list.

This selects the Dynamic Related List–Single component and shows its properties in the properties pane. If you’ve worked in the Lightning App Builder before, you’re familiar with component properties.

Let’s start to customize the dynamic related list by defining how the list appears.

  1. In the Dynamic Related List–Single properties pane, leave the Related List Type as List. 
    (Note that in Tile view, you see each record as a tile in the list, but the fields that you can see are limited.)
  2. In the Number of Records to Display field, enter 6.

Now, let’s update the list columns and define the list’s sort order.

  1. In the Dynamic Related List–Single properties pane, scroll down to the Related List Fields section.
  2. Click  to remove the Close Date field.
  3. Click Add Field, search for and select the Type field, and then click Done.
  4. Click Add Field, search for and select the Probability (%) field, and then click Done.
  5. Drag to move the Probability (%) field above the Type field.
  6. In the Sort Field dropdown menu, select Stage.
  7. In the Sort Order dropdown menu, select Descending.

Now, let’s update the actions on the list. In order for users to see the actions that you add on the related list, you also need to make the action bar visible. 

  1. Scroll down to the Actions section and click Add Action.
  2. Search for and select New action and click Done.
  3. Scroll back up in the properties pane and verify that the Show list view action bar box beneath the Number of Records to Display field is checked.
  4. Save the page.

There’s one more step to customizing the list: Filtering the list to show only the records that your users need. If you needed another reason to upgrade to dynamic related lists, this is it. And the only way to customize related list filters is to use the Dynamic Related List-Single component. You can’t add custom filters to a related list that you add from the page layout editor. 

  1. In the Dynamic Related List–Single properties pane, scroll down to the Related List Filters section and click Add Filter.
  2. Create a filter:
    • Field: Stage
    • Operator: not equal to
    • Value: Select Closed Won and Closed Lost
  3. Click Done.

Now that the list is filtered to only show open opportunities, let’s give it a descriptive name so users know what records to expect.

  1. Scroll back up to the top of the Dynamic Related List–Single properties pane.
  2. In the Related List Label field, enter: Open Opportunities by Stage
  3. Save the page.

That’s it! We created a new dynamic related list, customized how it looks on the page, and filtered it to show only the most relevant related records. But what does it look like to our users? Before we find out, we need to activate the page.

Activate the Page

There are a few different options for activation, but we’re going to make this page the org-wide default for all opportunity pages on desktop.

Account record page activation.

At the top of the Dynamic Related List–Single properties pane, click Activation.

  1. Click Assign as Org Default.
  2. Make the page available for desktop.
  3. Click Next, then click Save.
  4. Save the page.

Simple! Now the page is available to users on the desktop form factor. Let’s go see the finished result.

See What Your Users See

  1. From the Lightning App Builder header, click Back ("").
  2. If you’re directed to the United Oil & Gas Corp. account page, refresh the page to see the changes.
  3. If you’re not directed back to the United Oil & Gas Corp. account page, from the App Launcher (App Launcher), select the Sales app.
  4. Click the Accounts tab.
  5. Select the All Accounts list view.
  6. Click United Oil & Gas Corp.

Opportunity dynamic related list on Account.

Nice! In the Related tab you can see the related list that we added, filtered to show open opportunities and sorted by stage. We also added the New button, so your users can create a new opportunity right from the account record.

And, if you click the View All link, you can use quick filters to further filter the records in the list. You can also see the filters that you defined in the Lightning App Builder. Note that your users can’t remove these filters, but you can always configure them differently based on their feedback.

Opportunity related list View All page and filters

Now that you know something about what dynamic related lists can do, give it a try in your own org! To take it one step further, you can even add a second related list on the account record page that’s filtered to only show Closed–Won opportunities. Once you start using dynamic related lists, it won’t take you long to see all the benefits it provides! 

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈