In 2019, Dynamic Forms was released in Dreamforce as one of the best features in the UI enhancements roadmap in Admin & Lightning Keynotes.
Today, Dynamic Forms are available like Non-GA Preview in Salesforce Summer ’20 release.
It’s going to be a most-significant feature that will bestow the consultants and admins the strength to have granular control on the record pages. Now, you can declaratively customize the fields and sections of the page according to your business needs.
This post will talk about what Salesforce Dynamic Forms are, working, its setup, and more.
What Are Salesforce Dynamic Forms?
When we create intuitive, user-centric page layouts that reveal the correct details at the right time are Dynamic Forms.
With time, the “Details” section or the page layout in Lightning pages can become overloaded with fields. Such fields may be required but not for all the users or all the time.
Config-intensive and labour are the closest resolutions to craft various page layouts and distinct profiles.
With Dynamic Forms, we can:
- Place the fields anywhere on the layout without needing to append them to the traditional page layout (“Details” tab).
- Utilize the visibility rules to create fields and components that appear and disappear as per our chosen criteria.
- Do away with various page layouts.
- Enhance page load times.
When can I get Salesforce Dynamic Forms?
- You can get the Salesforce Dynamic Forms from the Lightning record page of a custom object.
- You need to pick the “Record Detail” or “Highlights Panel” component.
- Next, you will see an option of “Upgrade Now.” You can pick between starting from scratch or migrating the current page.
How do Salesforce Dynamic Forms Work?
A brand-new standard Lightning Component arrives with Dynamic Forms, known as ‘Field Section.’ You just need to append that component to the page, choose the fields you need to append in the section, and craft a filter to define:
- when to show the section,
- on what form factor to display it, and
- whom to display it.
How do I set up Salesforce Dynamic Forms?
Let’s check out the steps to set up Dynamic Forms:
1. Create or migrate a page
- You need to open the Lightning page that you want to upgrade for any custom object. Next, select the “Highlights Panel” or “Record Detail” component, and select “Upgrade Now.”
- Also, you can craft a brand new page just by jumping onto your custom object, choosing “Lightning Record Pages,” and then selecting “New.”
- After you create or migrate a new Lightning record page, an option will be visible to you which will allow you to add a “Field Section” component that will enable you to append fields to the Lightning record page directly.
2. Add fields to a component
After adding a “Field Section” component onto your page, you can next append individual fields. You can add a “Field Section” in many places other than tabs.
Let’s first append some fields that should be visible to all who view the record:
- Remember to name every field section.
- You can pick the UI behavior with a selected field, like “Required” or “Read Only.”
3. Make fields and components conditionally visible
We can make visible both the fields and all the field components.
The behavior of the Field Section and Field visibility is different. However, both are dynamic, and as the users make changes, fields appear to be super dynamic. It states that a field holds power to appear or disappear while a user changes the record.
On the contrary, Field Sections are just edited on Save, so a new section appears or disappears after the user saves the record.
4. Plan page performance
When we select accordions or tabs, they get elected. So, despite appending multiple “Field Section” components to the starting page, you can use the accordion or tabs for enhanced performance and load.
5. Add a mobile component
If you want your mobile users to check out the “Details” fields, you need to append a component, namely “Record Detail – Mobile,” to any pages you craft. It’s because the new component, “Field Section,” doesn’t exist on mobile. Any migrated pages will include this component automatically.
We can start using Dynamic Forms in two ways:
- Build a custom object record page, next, drag Field and Field components onto it.
- Or, open a current record page and migrate its record details utilizing a migration wizard.
A Quick Guide to Getting Started with Dynamic Forms in Salesforce
Let’s look at how to start with Dynamic Forms in Salesforce. This guide will cover all.
- Enable Dynamic Forms
- Add Field Section Component to Lightning Record Page
- Create Filter to Set Component Visibility
- Test Dynamic Forms
1. Enable Dynamic Forms
From the Setup, you need to enter the Record & choose “Record Page Setting” in the quick find box.
In the Dynamic Form section, you need to select any Record Page View & next, tap the save button.
2. How to Use Dynamic Forms?
We can craft a new Record Page for any customized object to migrate to a current Lightning Page using it.
Here, you can check out a new feature in Lightning App Builder.
The Field tab holds a new standard Lightning component known as “Field Section” & “Field Components in the component palette. You can append the field “Section” on the page and choose the fields to append in the section.
You can simply use Dragging fields & sections and tap on “Upgrade Now” from the Record Details properties if you want to release the Dynamics Forms migrated wizard.
Post that, the Dynamic Forms migration wizard appears. Then, you need to tap on “Next.”
Next, you can choose a page layout like a dynamic forms’ source, pick a page layout & tap “Finish” to accomplish the Dynamic Forms migration wizard.
So, as the successful migration of Dynamic Forms is achieved, the new fields section and field components will move to the desktop as it appends the “Record Detail – Mobile” components to the pages so that the mobile users can see the “Details” field.
Post this in the information section; you can drag the “Field Section.” Also, we can modify its label to “System Information” and select 1 or 2 column styles.
3. Add Field Section Component to Lightning Record Page
We can modify UI behavior by converting any fields belonging to Policy Object to “required” or “read-only.”
Also, we can append the filters to the fields and append advanced filters according to the needs.
4. Create Filter to Set Component Visibility
Next, you can tap on the “Activate” and “Save.” It will activate the page layout for the custom object.
4. Test Dynamic Forms
First, we‘ll be logged in as a sales rep; it will allow the navigation to the custom objects and taps a record. Next, according to our setting, we can see the standard ‘Record Detail’ component.
Ahead, we’ll be logged in as a support rep who works on a Customer’s Case relevant to their order shipment. So, we tap the record.
As we know, Dynamic Form is a game-changing feature. So, we can rapidly customize pages according to the profiles, field values, or other custom filters.
What Are The Benefits Of Dynamic Forms?
Now, let’s check the benefits of Dynamic Forms:
- Despite allocating a page layout and Lightning page separately, it utilizes a single assignment model for the Lightning page.
- It simplifies or lowers page layouts by turning visibility rules into components compared to the entire layout.
- You can handle the sections and fields on your pages in the Lightning App Builder without using the page layout editor.
- Dynamic Forms offers a fascinating visual interface that permits us to check the fields they need to be the end-user.
- Dynamic Forms append the sections and fields into the tabs or components accordingly to improve website load times.
- Rapid upgrade from page layouts: Place sections and fields wherever you want.
- Lowers the number of page layouts you want with component visibility rules.
- Reap benefits of a single assignment model for the Lightning page regardless of the dual-mode of assigning a page layout and a Lightning page.
Limitations of Salesforce Dynamic Forms
Now, let’s check the constraints of Dynamic Forms:
- It doesn’t support blank spaces, and the Traditional Page Layouts will constantly control relevant lists.
- It’s not supported on record pages with the custom page templates and pinned regions.
- As the new Field section and field components are not compatible with mobile devices, you need to craft a new Record-detail – Mobile Component.
- We can append up to 100 fields/columns in a field section component.
- Presently, just custom objects support dynamic forms.
- Dynamic Forms doesn’t operate in Internet Explorer 11. Users with IE 11 who attempt to view a page that uses Dynamic Forms can see a page with an error.
- It doesn’t support blank spaces.
- Just fields and sections holding fields are enclosed when migrating a page to Dynamic Forms. Other elements, like blank spaces and custom links, aren’t included in the page layout.
- If you edit a section converting two columns into one, the new column can hold 100 fields. If you have more than that in two columns while switching to one column, it will move the first 100 fields to a single column and drop the remaining fields. After converting, if you change your mind, you can instantly click the undo button, namely the Lightning App Builder Undo button.
- On record pages, Dynamic Forms is backed just for custom objects.
- Dynamic Forms doesn’t perform well on pages based on custom and pinned region templates.
- You can append up to 100 fields/columns in a Field Section component.
- If the page layout you select to migrate holds more sections and fields that we handle, allow migrating up to 100 sections in every region and the first 100 fields in every column. The remaining fields are dropped, even if they are needed ones. Later, you can manually append dropped items. After switching, if you change your mind, you can tap the undo button, namely the Lightning App Builder Undo button, to roll back the modifications.
- Users can collapse or expand field sections just in inline edit or view mode, not in the create, full edit, or clone windows.
Dynamic Forms Known Issues
- From the Path component, if you tap on View All Dependencies, the dependencies you view come on the page layout from the record, not from the Dynamics Forms fields, on the page.
- The CurrencyISOCode field is not shown as needed at runtime. However, it still behaves as required.
- On a Dynamic Forms-based page, many instances of the same lookup field lead to a page error that looks up to an object that’s not supported in the UI API.
- If you tap New from the related list for a non-UI, API supported object holding a Forms-enabled object like a related list; the parent lookup field doesn’t occur in the New dialog. Still, you can save the new record.
- The Macro Builder doesn’t support Dynamic Forms field components. In the Macro Builder, when a Dynamic Forms-enables record is opened, the field components stay disappeared.
- Density settings are not admired in the Lightning App Builder preview for field sections, and Lightning App Builder preview reveals the Comfy setting always for field sections. During runtime, proper density settings are applied.
- From a lookup, if you build a record, the fields that appear on the window don’t come from the Dynamic Forms fields on the page; instead, they come from the record details.
When you hover over the fields in the palette, the shown data types are inaccurate in the palette.
- In two-column Field Section components, the fields don’t align correctly, horizontally.
- A printable view of the record is not based on the fields on the Dynamic Forms-based page; rather, it depends on the fields from its default page.
How to Break Up Your Record Details with Dynamic Forms
On your page, the more fields you have on your page, the more the Record Detail component becomes a monolithic block of un-customizable fields.
With Dynamic Forms, you are allowed to migrate the sections and fields from your page layout like individual components into the Lightning App Builder.
Next, you are permitted to configure them like the remaining components on the page and offer the sections and fields to the users of that page only as per their needs.
Apart from affecting how users see fields on the record page, Dynamic Forms affects what they see when they tap to create, edit, or copy a record.
On Dynamic Forms-based pages, such fields that users see when editing, creating, or cloning doesn’t come from the page layout; they come from the fields on the page.
How to Migrate a Record Page in Dynamic Forms
In Dynamic Forms, you can migrate the sections and fields from your current record pages like individual components in the Lightning App Builder.
Next, you can configure those record pages like the remaining components on the page and offer users just the sections and fields they require. Dynamic Forms is backed just for custom objects.
Steps Involved to Migrate a Record Page in Dynamic Forms:
1. Open the current custom object record page for Lightning Experience as below:
a. For the first time, when you choose Edit Page, Salesforce makes a copy of the standard page, which you edit in the Lightning App Builder. If a customized page exists and is active, selecting the Edit Page will open that page to edit.
b. In Setup from the Object Manager, open a custom object; next, pick Lightning Record Pages.
c. From the Lightning App Builder list page in Setup, open a custom object record page
2. Click the Record Detail component.
3. Click Upgrade Now in the component detail pane to start the Dynamic Forms migration wizard.
4. Go through the wizard, and choose which page layout holds the fields you need to migrate to the page.
As part of the migration process, the Record Detail component is erased from the page and replaced with sections and fields that you can place and configure anywhere.
If your record page backs the phone form factor, a “Record Detail – Mobile” component is appended to your page as a part of the migration. This new component is distinctive, and it showcases the standard record detail fields and sections to the users when they view the page on their mobile device.
How to Required and Read-Only Fields in Dynamic Forms
When you perform with universally needed fields on a Dynamic Forms-based Lightning page, they retain their status. Although, you are allowed to make other fields read-only or required only for the page on which you are working.
Dynamic Forms and Mobile
The Field components and the Dynamic Forms Field Section component inside it are desktop-only. Still, the mobile users are covered.
The Record Detail – Mobile component offers the mobile users a pathway to get the record details on a Dynamic Forms-enabled page.
Dynamic Forms Tips and Considerations
You need to keep below tips and considerations in mind when working with Dynamic Forms.
- The Record Type and Owner fields catch up with special handling in Dynamic Forms. They are set to Read-Only, which is not editable in the properties pane.
- Like the App Builder counterparts, the accordion components’ programmatic versions don’t offer the same functionality. For instance, lightning and lightning-accordion components currently don’t support lazy loading.
- When we clone a record dependent on a Dynamic Forms-enabled page holding the visibility rules, referenced in the visibility rules, all the fields are appended to the cloned record, even if those fields are already on the page.
- On a page, when you switch page templates that utilize Dynamic Forms, the available templates’ list holds just the templates that are backed for the Dynamic Forms-enabled page.
- We can append one and even more instances belonging to the same field to a Lightning page. Still, all the instances on the page reveal the same data.
- While designing a page, collapsing or expanding a field section stay ineffective on whether a section is collapsed or expanded for users during the runtime.
- When we save a new record with a blank custom object name, the API occupies the custom object name field with the record ID. So, we need to ensure that the Name field is marked as required and is on the page.
- You shouldn’t place Field Section components on mobile-only Lightning pages as they are desktop-only and don’t appear when you view the page on the phone.
- It’s usually recommended that you shouldn’t have both field sections and a Record Detail component on the same page. If you do, the users can have problems with the page, embracing: overlapping, multiple save and cancel bars when both are in inline edit and on the page.
- Visibility rules don’t work correctly on the Field and Field Section components.
- When users edit, create or clone a record, the fields that appear are not from the Record Detail, instead are from the Field Sections.
- Record Detail is left-right-top-down tab order, while Field sections are top-down-left-right tab order only that can create confusion. Resultantly, inside a Field Section, sometimes the fields don’t line up horizontally. Still, Record Detail fields do line up horizontally.
- You can utilize one Lightning page for both phone and desktop. Append the Record Detail – Mobile component with your Field Section components on the same page. Your desktop users look at the Field Section components, whereas your mobile users see the Record Detail – Mobile component.
Visibility Rules and Dynamic Forms
- On a page, if the field is hidden because of a visibility rule, and if a user edits the field’s value, the new or changed value will stay unsaved.
- The visibility rules behave uniquely on the field sections component as they do on fields. On fields, the visibility rules are assessed dynamically. While editing a record, the user’s modifications appear and disappear as the visibility rules are evaluated.
- The visibility rules are not dynamic and don’t react to users’ editing on the field sections. Field section visibility rules are evaluated just after the record is saved.
- Dependent picklist fields don’t pay any heed to visibility rules. Even if they have assigned the visibility rules, the dependent picklist appears in the View All Dependencies list.
We have included almost every detail related to the Salesforce Dynamic Forms, its benefits, limitations, setup details, working, and more.
Salesforce Dynamic Forms offer end-users a unique experience while improving organizational productivity. Further, such forms can be customized quickly with no need for complicated programming or coding. For now, such forms are just accessible for custom objects; soon, Salesforce will make this feature also available for regular objects.
We hope this guide is quite informative and will assist you with your queries. Still, if you are stuck with any issue in Salesforce development, you can connect with us; we’ll help you with better solutions.