In the Summer’22 release Salesforce introduced a new Lightning component to display a single dynamic related list. For instance, you can render High priority Cases on the Account page or show Opportunities at a specific stage.
Let’s see how it works in detail.
Dynamic Settings
In addition to selecting objects, you can now set up several parameters to control what exactly records to display.
![Component selection in the Lightning App Builder](https://enway.com/wp-content/uploads/2023/01/component_selection.png)
The following parameters are available to set up:
- Parent Record
- Related List
- Related List Label
- Related List Type
- Number of Records to Display
- Fields to Display
- Sort Field
- Sort Order
- Filters
- Actions
![New Dynamic Related List](https://enway.com/wp-content/uploads/2022/05/drag-and-drop.gif)
Related List Fields to Display, Sort Order and Filters are very straightforward. Let’s set up the view of High priority cases ordered by the Date Opened:
Pros and Cons
➕ | ➖ |
---|---|
Use several filters to render the records you want | 30 records max (no “View All” option) |
Sort order by a field | No preview in the Lightning App Builder |
Control fields to display | Only list actions are available |
Conclusion
The dynamic related list component is a great declarative way to show filtered records. With just a few clicks, you can display the data you want (without custom development involved). But, you need to keep in mind some limitations with a number of records and actions.