Quick Tip – Summary Tab & Partial Dynamic Forms

Thou shalt make your Lightning Record Pages as fast as possible. In so doing, thou shalt not create a maintenance nightmare.


The Hook (If you’re hooked by this, you are truly a Salesforce nerd)

We often have to balance two competing priorities: 1) Records should display specific information to specific users, and 2) Maintaining these differences should be as easy as possible. Of course, the number 1 goal governing both of these should be that User Experience is paramount, and the required information needs to be displayed as quickly as possible. Record Detail components are the traditional way of differentiating based on record or user characteristics, but are often quite slow due to the number of fields that are shown (many of which may only be rarely needed). Therefore, we’d prefer loading a smaller component during the initial page load, and only accessing the Record Detail if it is actually needed. This is where the concept of a ‘Summary’ tab using Dynamic Forms comes into the picture.

Lightning Record Pages offer Dynamic Forms as a replacement for reliance on Record Detail Page Layout components. With Dynamic Forms we can conditionally show or hide certain fields based on record or user context, which is a great feature. However, it seems we need to ‘Upgrade’ to Dynamic Forms from a Record Detail component, which leaves us unable to use the standard Detail Page Layouts. An additional problem is that we often want drastically different information presented depending on Record Type or User, and trying to maintain everything in a single Dynamic Form on a single Lightning Record Page isn’t possible. The natural inclination is to start creating different Lightning Record Pages based on Profile, Record Type and/or App, and having a different Dynamic Form for each. This can quickly spiral out of control and create a serious maintenance headache, and why not continue to utilize our existing Detail Page Layouts to perform the dynamic presentation on our behalf? In summary, how can we utilize Dynamic Forms and maintain our Record Detail components on the same Lightning Record Page?

The Scenario

On the CPQ Quote object, we’d like to display a ‘Summary’ tab that is a small collection of fields that are relevant for all Users and Quotes (regardless of any Quote attribute such as Record Type). Outside of that Summary tab, we have a wildly different set of fields that may be relevant to certain Users or Quote types, and these already exist as Detail Page Layouts that we’d like to reference on the Lightning Record Page. All other components on the Lightning Record Page would be shared, so we don’t want to start creating multiple Lightning Record Pages and trying to maintain across Apps, Record Types and Profiles. Thus we need to figure out a way to employ Dynamic Forms for use on the Summary tab, but leave our Detail Page Layouts as they are, so that depending on the User/Record Type, they will see these detail fields as they do today.

To solve this issue, there is a simple trick we can employ. It may just be my ignorance that leads me to think this is an interesting solution, and perhaps others have long since been employing this approach! But I thought to share just in case others are in my boat as having noticed this only more recently.

The Solution

We are going to partially upgrade to Dynamic Forms. How?

First we edit the Lightning Record Page for CPQ Quote. Add a new tab and change the tab label to ‘Custom’ and enter a custom label of ‘Summary’

Set the Summary tab as the first tab, and the Lightning Record Page Default tab. This will ensure that the light component is the only one loaded when the page is opened, thus speeding the performance drastically vs. loading the full Record Detail component.

Now, add the ‘Record Detail’ component to the Summary tab.

On the Summary ‘Record Detail’ component, use the ‘Upgrade Now’ button to convert this Record Detail to a Dynamic Form. Navigate through the subsequent menu to convert from an existing Detail Page Layout as desired. We’re going to delete most of this anyways, so it doesn’t really matter.

Delete all the existing blocks added to the Dynamic Form. Then add a new Section, and title it ‘Summary’.

Now we’ll add a few key fields that every user will want to see when landing on the Quote page. Remember, we want to minimize load times as much as possible, as the user may only be interested in getting to the Actions or Related Lists from the record, so we shouldn’t load anything we are not confident that they will want to access.

When finished, Save the Lightning Record Page. Notice here that on the Summary tab we have a Dynamic Form, but on the Details tab, we still have a non-upgraded Record Detail component that will dynamically show the correct Detail Page Layout based on the User and/or Record Type of the Quote. This gives us the best of both worlds, as we can get the common and quick-loading Summary using Dynamic Form while still utilizing our existing Detail Page Layouts.

Let’s check the resultant page, and you’ll see a noticeable load time improvement right away.

Note here that for many of you, making this simple change will make the Page Performance popup disappear from the Lightning Record Page builder, as the change from initially loading the full Detail Page Layout to the Summary tab only will drastically improve page load performance and take us into a “Good” rating where the popup no longer shows.

Keep in mind that the other most common long-load time component will be Related Lists. Do not show these directly on the Lightning Record Page, but rather put them on their own tab, so they are only loaded on demand. A better approach is often the Related List Quick Links, or to just surface the most commonly used Related Lists as Related List – Single on the Lightning Record Page, so only those needed frequently are sucking up page load time.

The Conclusion

Using this trick of having a Lightning Record Page with partially upgraded Dynamic Forms can greatly improve page load times, and also allows us to utilize existing Detail Page Layout assignments, without having to also maintain a ton of Lightning Record Pages and assignments. The key is to get the best performance we can, while having the lowest maintenance overhead possible, which we can often achieve using this approach. Perhaps this will help you, though it could be that I am the last one to the party in using this trick!

Leave a Reply

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