Salesforce Dynamic Forms

Serhii Force blog
Might and Magic of Salesforce
14 min readFeb 22, 2022

--

Salesforce dynamic forms were initially introduced in 2018 at TrailheaDX. At that time, they were called “Lightning Layouts“, an innovative alternative to classic page layout editors.

Its greater flexibility and user-centric interface became an important reason why businesses hurried up to switch from Salesforce Classic to Lightning.

Especially, after Summer 20’ release when Salesforce dynamic forms and actions became an even better enhancement.

These features can improve the lives of your busy salespeople that need to get necessary records just in a few clicks or newbies who can easily get overwhelmed by too many fields on the page. Sounds familiar? Read how dynamic forms and actions can cope with these tasks.

What Are Salesforce Dynamic Forms?

Salesforce dynamic forms are aimed to create user-friendly page layouts that show the right information exactly when you need it.

This platform enhancement was the most requested feature on the Idea Exchange portal, and it initially appeared in Beta in Summer ’20 Release.

Why Salesforce Dynamic Forms?

Thanks to Salesforce Dynamic Forms, you can create an intuitive on-page experience without spending hours creating several page layouts for different profiles.

Unfortunately, over time, the page layout (also known as the “Details” tab) in Lightning pages, can get buried in fields. They may be very important, but you may not need these fields all the time. Or not all of your colleagues may need to see them all.

Salesforce Dynamic Forms Benefits

Dynamic forms in Salesforce have numerous advantages like:

  • No need to use Visualforce or custom coding. You can do it thanks to Salesforce dynamic forms.
  • Ability to upgrade to dynamic forms directly from a Lightning App Builder
  • Easy customization process
  • Ability to split all the information and place it appropriately anywhere on the page without adding fields to the standard page layout (“Details” section)
  • The more readable and less cluttered pages layout
  • A single assignment model that assigns only lightning page to profiles rather than assigning a page layout and lightning page
  • Ability to show and hide fields and components depending on the conditions you set
  • No need to create multiple slightly different versions of the same page for different profiles
  • Ability to use a single Lightning record page with different visibility filters for different profiles
  • More granular control over the data you have
  • Faster page loading.

This alone can make you more efficient as a user thanks to the removal of a huge time vortex.

How Dynamic Forms Work

What’s the most interesting is the logic running the show behind the scenes — visibility rules.

For example, when you change status from “Evaluation” to “Purchase”, you can set a rule and make certain sections disappear and leave what’s really relevant — the purchasing details.

Or let’s take another example. When the status is “Manufacturing”, you want all the manufacturing details to appear and everything else to be removed.

Or if you have a dropdown with an option “Not Applicable” which will hide several text areas fields. You can now do this!

And all of these you can do simply by activating dynamic forms in Salesforce and making all the actions appear not too early or too late but exactly when you need it.

This is how this feature adds more value in terms of efficiency.

It gives us simpler and more convenient page layout management as we’ll be adding, modifying, or removing fields from the Lightning App Builder.

So, there is no need to switch to page layouts for fields and then switch back to the lightning page for all the other components.

If you want to make your Salesforce search as fast as your field selection, you can download our Ascendix Search app. It is designed specifically for busy salespeople who don’t want to waste their time browsing through their mass of data and get the exact search results in a moment.

How to Use Dynamic Forms

We can use Salesforce dynamic forms to meet different business needs and show particular sections of fields on the page layout based on the values of the other fields of the same object in the same record.

For example, if the Deal Custom Object reaches the negotiation stage, the page can display the fields related to discounts like discount percentage or amount.

Or if you work with Inquiries and you specify the lead source as a website, you may want to show the field with the website URL.

Moreover, dynamic forms functionality is not limited to the fields on the current object. With them, you can display sections and fields depending on the values of fields on the parent object.

You can also create separate layouts or separate profiles. Or even for separate devices like desktops and mobiles.

Let’s take an example scenario.

Or if you need to add several new fields in the object that should be displayed to all the users.

And if you don’t want to add all those fields to multiple page layouts manually, you can use dynamic forms and add them in one place.

How to Enable Salesforce Dynamic Forms

To enable Salesforce dynamic forms, you need to activate dynamic pages first.

How to Activate Dynamic Page

To enable a dynamic page, you need to:

  1. Click on a Gear Icon,
  2. Click on “Edit Page”,
  3. Click on the space under the “Details” tab.

Now you can see sections and fields coming from the “Shipments” page layout.

On the right-sidebar, you can see the page layout name where it says “Shipments Page Layout Previewed” meaning that this is what we are currently reviewing.

There also is a new tab here on the left panel on the left-sidebar which is called “Fields”.

This tab has been added for the dynamic form.

How to Enable Salesforce Dynamic Forms

To enable a dynamic form, you have to:

  1. Click on “Upgrade Now” on the right sidebar. There you’ll see some information about dynamic forms.
  2. Click “Next”.
  3. Select the page layout that you want to migrate from. Salesforce will move all the sections and fields from that page layout to dynamic forms.

Note* if you check the box “migrate fields and sections into an Accordion component to improve page performance”, they will be displayed in collapsible components in HTML.

4. Click on “Finish” and “Save”.

Note* If you create the Lightning page for the first time, Salesforce will prompt you to activate the page. So, you need to click on “Activate.”

And if you assign the Lightning page as “Org Default”, all the platform users will see the same page layout.

  1. Select the form factors for both desktop and phone.
  2. Click on “Save”.

In Salesforce, you can upgrade the traditional layout to dynamic forms by simply using a Migration Wizard just in a few seconds.

Besides that, you can:

  • Specify UI Behaviour (None, Read-Only, or Required)
  • Set Field Visibility to make this migration to be as seamless as possible
  • Quickly rearrange the fields and sections. All you need is to place them within appropriate tabs
  • Create a custom section with fields from scratch
  • Create some visibility rules. For example, hide a section when the status is “Purchased” or “Manufactured.”

A Few Words About Visibility Rules and Permissions in Salesforce Dynamic Forms

The main advantage of applying visibility rules is that you don’t need to change an entire layout to simplify the interface. You just need to set a single rule.

You can set visibility rules based on other records, characteristics of the user, and your devices of choice.

Such an improvement is especially useful for complete newbies to the platform who may not need all the fields available by default because it can confuse them. And it can be solved by setting visibility rules instead of total reconfiguration.

All of these settings can be done within a couple of minutes for an experienced admin and serve as a huge time saver for users. But, if you need extra help and guidance with enabling dynamic forms, actions, or interactions, you can contact us. We will simplify your way to greater efficiency.

Salesforce Dynamic Forms Limitations

There are several constraints you should know about:

  1. Dynamic Forms Are Generally Available Only for Custom Objects

Dynamic Forms are currently supported on record pages for custom objects only. For standard objects, you will need to wait for a couple of more releases.

2. Fields & Sections Limits

You can add up to 100 fields per column in a field section component. Also, during transfer, only the first 100 sections and the first 100 fields in each column can be migrated. The rest of the fields will be dropped even if they are required.

So, once you have done the migration to Dynamic Forms, you will need to add those fields manually.

Besides that, if you convert a section from two columns to one, the new single-column will hold 100 fields and the rest of the fields will be dropped.

3. No Elements Except for Fields and Sections Can Be Converted

When you migrate from a page layout to dynamic forms, only fields and sections are included. There could be other elements on a page layout like the custom links and the blank spaces that will not be migrated as they are not yet supported in Dynamic Forms.

4. Salesforce Dynamic Forms Do Not Work on Pages Based on Pinned Region and Templates

So, when you create a Lightning page, you can choose the page template, and some of those templates can include pinned region templates. Or you can create a Lightning page template using Aura components because Dynamic Forms currently do not support this kind of template.

5. Internet Explorer 11 Is Not Supported

Dynamic Forms do not work in Internet Explorer 11. So, users with IE 11 will see an error.

6. Field Section Management Limitations

You can expand or collapse field sections only when you are in an online view or edit mode. You can’t do it when you are in the full edit, create, or duplicate windows.

Dynamic Forms Known Issues

Here is the collection of the reported cases you should consider if you plan to switch to Salesforce dynamic forms:

  1. Density Settings for Field Sections

Density settings for field sections are not honored in the Lightning App Builder preview. Its preview always demonstrates the parameter for field sections. Appropriate density parameters are applied at run time.

2. Some Dependencies Are Not Displayed Correctly

The dependencies you notice when you click on “View All Dependencies” from the Route component appear from the record details on the page layout, not from the Dynamic Forms fields on the page. As well as if you search for a record, the fields in the window that shows up come from the record details, not from the Dynamic Forms fields on the page.

3. Non-UI API-compliant Objects May Not Show Up in a New Dialog

For a non-UI API-compliant object that has Forms-enabled objects as a related list, if you click “New” from the related list, the main lookup field doesn’t show up in the New dialog. However, you can save the new record.

4. Dynamic Forms Field Components Are Not Supported Within the Macro Builder

When a record page with a Dynamic Form is open within the Macro Builder, the field components do not appear.

5. Some Visibility Rules Issues

Visibility rules related to parent object fields may not behave properly.

Also, if you duplicate a record depending on a Dynamic Form-triggered page that has visibility rules, all fields referenced in the visibility rules are added to the duplicate record, regardless of whether those fields are on the page.

The field rules used in the rule evaluation and the saved value of the field in the replica record may differ based on the replica user’s access to the field used in the visibility rule.

6. Other Known Issues

  • Fields in two-column Field Section components do not adjust horizontally properly.
  • The CurrencyISOCode field is not showcased as requested (with the *) at runtime, however, it still works as needed.
  • On a page depending on Dynamic Forms, numerous instances of the same lookup field looking for an unsupported object in the interface API ends in a page error.
  • The print view of a record is based on the fields on its standard, not the fields on the Dynamic Forms-based page.

Salesforce Dynamic Forms vs Salesforce Dynamic Actions: Key Differences

Unlike the concept of Dynamic Forms, Dynamic Actions allow us to control the visibility of action buttons from the Lightning page.

What is a Dynamic Action?

Dynamic action simplifies a way to create complex yet intuitive pages based on set conditions declaratively without applying custom coding. It’s available in many CRM platforms like Salesforce, SAP, and Oracle.

What are Salesforce Dynamic Actions?

Similar to dynamic forms, Salesforce dynamic actions were introduced in Summer “20 Release.

Thanks to them you can define an action that will be carried out when specific criteria are met. Like with dynamic forms, we can control the visibility of these buttons based on certain conditions.

Salesforce dynamic actions enable platform users to choose actions based on their role and configure them directly in the Lightning App Builder instead of the standard page layout editor.

You can also determine which items are affected by the action as well as when and how they are affected.

With dynamic actions, you can reduce the clutter of action buttons. You can choose precisely which action button should appear.

For example, you may want to show the Tracking action button when the shipment is in transit. Before the shipment is in transit, there is no benefit of tracking or the tracking is not usually available.

You can display or hide action buttons based on the picklist values. Or, if you no longer want the user to change the record owner, you can also show/ hide action buttons based on the values or fields on the parent object.

And then you can control the visibility of buttons based on the profiles or the form factors.

What Are Salesforce Dynamic Actions Benefits?

The main advantage of Salesforce dynamic actions is that they really can help cut down on org management. Moreover, they can:

  • Speed up actions upgrade from a single place (Lightning App Builder) via user-friendly UI
  • Improve the quality of configurations thanks to a live preview
  • Personalize visibility of certain actions for quicker access to necessary processes
  • Streamline layout management by using a single assignment model for the Lightning page instead of a mixed model of assigning a Lightning page & a page layout
  • Decrease the number of page layouts.

How to Use Dynamic Actions in Salesforce

You can use dynamic actions for a number of activities like:

  • Display a certain action button depending on the value of other fields
  • Show or hide action buttons based on the picklist value fields
  • Display different buttons for users depending on the form factor.

How to Enable Salesforce Dynamic Actions

To get started with Dynamic Actions in Salesforce, you need to turn on them in the Lightning App Builder for every Lightning Page you’d like to use these actions on.

Now all the buttons disappear. And if you just click on ”Save” and go back to the record page, you won’t see any buttons except for enabled ones.

Also, you have an option to hide the buttons, add some buttons and conditions here.

If you want to see action, you need to click on an “Action” from the dropdown menu. If you click on a “Field”, you will see all the actions that are available on this object.

This includes standard, quick, and global actions.

You can change the number of visible action buttons to any number.

To add a new Lightning Page in a Lightning App Builder, follow the steps:

  1. Log into your Salesforce Org
  2. Click on “Setup”
  3. On the “Quick Find” move to “Lightning App Builder”
  4. Click on the “New” button and choose “Record page” on the “Create a new Lightning page”
  5. Fill in a value for “Label” and choose a necessary custom object and click on the “Next” button
  6. Pick any one of the Standard Page Templates on “Create a new Lightning page” and click on the “Finish” button

To enable dynamic actions in Salesforce, you need to:

  1. Click on the Gear icon
  2. Click on the “Edit” page
  3. To convert this to dynamic actions you need to click on this “Highlights Panel”
  4. When you click on the “Highlights panel” on the right sidebar you are going to see prompts to upgrade to Dynamic Actions. Click on “Upgrade Now”
  5. Choose from two options: to migrate all the buttons from the existing page layout or you start from scratch
  6. Click “Next”
  7. Click on “Finish.”

To configure the Dynamic Actions Bar, follow the steps:

  1. In edit mode on any Lightning Page for custom and standard objects, choose the Highlights Panel (If you don’t have a Highlights Panel element on the layout, you’ll need to add one);
  2. Tick “Enable Dynamic Actions”
  3. Proceed to a new option — “Add Action.”

Once you’ve activated dynamic actions, think about actions that will simplify your business processes the most. Start with the generally used and apply them to any industry like “Clone” or “Edit”.

But remember that all the user actions will still be regulated by their permission sets. Besides adding actions, you can:

  • Rearrange actions
  • Make them visible based on a user’s profile and the field value.

How to Turn off Dynamic Actions in Salesforce

If you’ve faced an issue when Dynamic Actions overwrite action buttons for a specific object, you may need to disable dynamic actions and turn back to the original set of action buttons.

But it should be noted that once enabled, this specific Salesforce element of the highlights panel can’t be reverted, only upgraded.

And if dynamic actions must be turned off for any reason, remove the upgraded highlights panel and drag a new one into this Lightning page layout.

When the activity is successfully completed, you’ll see “Upgrade to Dynamic Actions”. Otherwise, Salesforce will use the page layout’s default action buttons.

Salesforce Dynamic Actions Limitations

Despite their undoubted advantages, Salesforce dynamic actions have limitations and issues widely discussed on various threads on Reddit, Discord channels, and Trailhead. Among them are:

  1. Dynamic Actions Are Still Not Generally Available

Since Winter ’21, dynamic actions are generally available for desktop users for custom objects and beta for certain standard objects (Account, Contact, Case, Lead, and Opportunity). However, for mobile users, it’s available only in Beta.

2. You Won’t Be Able to Control Dynamic Actions Though Page Layout

This is among the top downsides of dynamic actions according to SFDX chat.

Salesforce Dynamic Forms & Actions FAQ

  1. How to Undo Dynamic Forms and Actions if You Want to Go Back to the Page Layout

Dynamic Forms and Actions are not a one-way street. Even if you have enabled them, you can always disable them and go back to the page layout.

If dynamic forms and actions are enabled on the Lightning page, you need to understand if that is an org-wide setting or even an object-wide setting. Because once you enable it, it cannot be disabled.

If you want to go back to the page layout, simply go to the “Edit” page.

Go to “Activation” and remove this page as an “Org Default”.

Once you remove it as an “Org Default”, Salesforce will display you the standard page which will use the standard page layout.

2. How Do I Use Dynamic Actions with Record Types?

One of the benefits of using a “Record Type” is that we can define multiple page layouts based on a record type, and we can assign these page layouts to different profiles.

To understand how dynamic actions can work with record types, let’s look at such an example:

We have the “Shipment” object, and let’s assume that this object has three record types: air, sea, and land. They define shipment methods. And there are three different page layouts for these record types. You can assign these pages to the same user profile based on this record type.

If you want to hide or show certain fields based on the shipment type, you can do it with dynamic forms.

You can take record types 1, 2, and 3 and you can build a one Lightning page layout instead of creating different page layouts.

3. Dynamic Actions Updated All Standard Object Pages

When you select “Migrate” and then choose the “Case Page” layout you want the action for, you may find that all page layouts for all standard objects have been updated, and some of the page layouts on the object may be missing fields.

4. How to Make a Formula Field Appear Based on the Record Type

To enable a formula field to appear based on the record type, you can create a new section with this particular field and add a filter to that section when a specific record type matches.

5. How to Enable Editing Existing Records on a Mobile App

To enable an edit button on a mobile app, you need to activate a separate filter on it. You can see if you are highlighted on the main Lightning record page.

--

--