Salesforce Dynamic Forms – Overview & Deep Dive Tutorial

Share this article...

The #1 asked for feature is here. It’s been 13 years in the making, 10771 votes, and 30 merged ideas; finally Salesforce Dynamic Forms are available in an org near you. 

In this post we’ll cover what Salesforce Dynamic Forms are, how to get started, as well as what is and isn’t supported.

What are Salesforce Dynamic Forms?

The premise of Dynamic Forms is to create user centric, intuitive page layouts that display the right information at the right time. Over time, the page layout, or “Details” section in Lightning pages, can become congested with fields. These fields may well be necessary but not all the time or to all users. The closest resolution we’ve had is to create multiple page layouts and different profiles, which is labour and config intensive.

Well no more. With Dynamic Forms you’ll be able to:

  • Place fields anywhere on the layout without needing to add them to the traditional page layout (“Details” tab)
  • Use visibility rules to make fields and components appear and disappear based on criteria you choose
  • Do away with multiple page layouts
  • Improve page load times

When can I get Salesforce Dynamic Forms?

Dynamic Forms are available now! Simply go to the Lightning record page of a custom object and select the “Highlights Panel” or the “Record Detail” component, then you’ll see the option to “Upgrade Now” and can choose between migrating an existing page or starting from scratch.

How do I set up Salesforce Dynamic Forms?

1. Create or migrate a page

For any custom object, open the Lightning page you wish to upgrade, select the “Record Detail” or “Highlights Panel” component, and choose “Upgrade Now”.

Source: Salesforce Summer ’20 Release Notes

You can also create a brand new page by going to your custom object, selecting “Lightning Record Pages”, then choosing “New”.

Once you’ve migrated or created a new Lightning record page, you will see the option to add a “Field Section” component which will then enable you to add fields directly to the Lightning record page.

In this example, I have removed the traditional “Details” tab and created a custom tab called “Candidate Information”. I then dragged a “Field Section” component onto my tab.

Note: You need to add a Fields Component before you are able to add fields!

2. Add fields to a component

Once you’ve added a “Field Section” component to your page, you can start to add individual fields. A “Field Section” can be added in many places, not just in tabs, so go wild!

First, let’s add some fields that should always be visible to anyone who views the record:

  • Don’t forget to name each field section!
  • With a field selected, you can choose the UI behaviour such as “Read Only” or “Required”.

3. Make fields and components conditionally visible

We can make both fields and entire field components conditionally visible.

Below, I’ve added a new “Fields Section” component titled “Confidential Information”, and made it visible only to users with the Profile name “HR”:

I’ve also made the field “Distance Willing To Travel” conditionally appear only if “Willing to Travel” is true:

This is a real game changer. In edit mode, our conditional field will appear once “Willing to Travel” is checked, without the user having to save or refresh the page.

Something worth noting is that Field visibility and Field Section visibility behave differently. Although both are dynamic e.g. can be set to appear or disappear based on filters you define, Fields are super dynamic as they are evaluated live (as a user makes changes). This means that a field may appear/disappear while a user is editing a record. In contrast, Field Sections are only evaluated on Save, so a new section won’t appear/disappear until the user saves the record.

4. Plan page performance

Tabs and accordion load only when selected, so instead of adding lots and lots of “Field Section” components to the initial page (e.g. what shows when you select a record), consider utilising tabs or the accordion for improved load speed and performance.

5. Add a mobile component

You’ll need to add a “Record Detail – Mobile” component to any pages you create so your mobile users can see “Details” fields. This is because the new “Field Section” component is not available on mobile. Any migrated pages will automatically include this component.

As well as setting up Dynamic Forms, you’ll still need to maintain the standard page layout because the mobile interface uses this – not Dynamic Forms!

What’s not supported?

  • Dynamic Forms is currently only available for custom objects; standard objects such as Accounts and Opportunities are not supported. To stay up to date on the road map for Dynamic Forms please join the Trailblazer Group here.
  • Dynamic Forms are not supported on record pages that use pinned-region or custom page templates.
  • The new Field Section component and the Field components are not supported on mobile. Any migrated pages will automatically have a new “Record Detail – Mobile” component added but you need to remember to add this if you’re building a page from scratch.
  • Traditional page layouts will still control related lists e.g. order of related lists and visible columns on related lists.

Resources

66 thoughts on “Salesforce Dynamic Forms – Overview & Deep Dive Tutorial

  1. again confusing terms….FORMS! A form is not what is being described it should be called DYNAMIC LAYOUTS…Salesforce has to strive for PRECISE nomenclature!!

  2. Noticed a different behaviour after enabling Dynamic forms. I was using “Compact” density setting before dynamic setting enabled. Once enabled and activated, Compact density setting is not working. Looks like that dynamic form is going to have only “Comfy” layout working for now…??

  3. Thank you so much for this article! I couldn’t figure out how to do this on my own – and turns out I am not able to do this yet on standard objects. Good to know before I wasted more time!

        1. No recent updates to when this will be available. There is a link at the bottom of the article to the latest roadmap – I would keep checking that!

  4. If you enabled in an environment but not in the target org, you’ll receive the following error during deployment, “Your org doesn’t have access to component flexipage:column”

  5. I’m struggling with filtering on fields on the parent page using fields on the child object. I have one to many, so I can’t add a lookup field to the child on the parent page. That seems to be a requirement to use the component filter unless I’m missing another step?

  6. I have created a field section and added few fields there and I wanted them to be Read only. So selected Read only in the UI behavior. But it is not reflecting. The tool tip for UI Behavior states that “If these settings are not editable, then the assigned behavior comes from the Object Manager Field definition”. I have not understood this properly.

  7. Added a Field Section on a Tab above a standard Record Detail component. The New record and Edit button functionality don’t work as expected rather you can only create/edit the fields in the Field Section while the Record Detail fields are not presented. Bug or intended behavior?

  8. So we have dynamic forms enabled, but for some objects it seems editing the fields is not available, but on others it *is* available. Not sure why or how to fix this. Any thoughts? I’m not marking any of the fields as read-only. The fields are not read-only on the default page layout either.

    The only difference I’m seeing at the moment is that I’ve overridden the edit function in classic to be a visualforce page. In lightning, I have that VF page embedded into the “Details” tab of the lightning page layout.

      1. Hello Christine,

        So if we use the Dynamic Forms, we can never use the page layout for new records? 🙁

        I mean, I love the Dynamics Forms, since you can distribute the details fields in different Tabs. But I want to use the Page Layout as the new record page.

        Thanks

        1. Christine Marshall

          Reply

          Hi,

          If you use conditional field sections/fields then these do not work with the “Details” component. In addition, when Dynamic Forms are used, the field sections appear when you create a New record, not the “Details” section.

          Best, Christine

  9. I’ve been playing around with Dynamic Forms and I want to confirm with everyone else on my findings:
    1) When making certain field(s) visible based on a condition set to the controlling field, this takes place after the new record is saved. Let’s say I want to make 3 other fields visible when I make Mission Code = 99A. If I’m creating a new record and set Mission Code = 99A, the 3 other fields are not made visible in the new record page. After I save the record, the 3 other fields appear.

    2) This is highly useful for full-license users meaning I can’t take advantage of Dynamic Forms on community pages, is that correct?

    1. Hi Jaclyn – that was not my experience. When creating a new record in your example, if you make Mission Code = 99A, the other 3 fields should display if it is setup properly. I’m not sure about the community pages – haven’t’ tried that yet.

      1. For me, field conditional visibility works without issue. When I try to apply a filter to a field section, all the fields in that section only appear AFTER the record is saved.

      2. For me, the individual field conditionally visibility works without issue. However, when I apply a filter to a Field Section, that field section only appears AFTER the record is saved.

    2. In my experience, when you trying to create new record or update an existing record, as long as you have the controlling and the dependent fields all within the same field section then the visibility works fine. If you have fields spread in different field sections, it works only on saving the record.

      1. Christine Marshall

        Reply

        Fields and Field Sections work differently. Fields are evaluated “live” as you make edits, Field Sections are evaluated upon save.

  10. It looks like certain field types cannot be used as conditions for field visibility (multi-select). Unless I am missing something?

    1. Christine Marshall

      Reply

      Hi Sunil,

      This is correct – multi-select picklists cannot be used for field visibility.

      Best, Christine

      1. Michelle Diotalevi

        Reply

        Hi! I have a picklist field and would like to use only certain values as conditions. Is that not possible? Thanks!

        1. Christine Marshall

          Reply

          Hi Michelle,

          Yes it is possible to use picklist values as filters. Click on the field and select ‘Add Filter’.

          Christine

          1. Michelle Diotalevi

            My apologies! I should have been more clear. Is it not possible to select more than one picklist value?

          2. Christine Marshall

            It is but it’s probably not that obvious because it doesn’t work like selecting values in a report or list view. Instead of selecting multiple values, you’ll need to create multiple filters. In each filter, select the same field but choose a new picklist value. Then make sure the filter logic makes sense e.g. all filters are true or add filter logic.

  11. Has anyone noticed that fields that are dynamically displayed keep the value of the field, even if it switches to hidden? So if you have field 1 as a Yes/No picklist, and then field 2 only displays if field 1 is yes…if you select Yes for field 1, then specify something in field 2, THEN go back and put No for field 1, field 2 disappears from the screen, but the value remains.

    Ideally, it would work like dependent picklists. Ive even tried it WITH dependent picklists. Making field 2 have no values associated with Field 1 = No. In the standard details page, if you select “No” for field 1, the values in field 2 get wiped out. This does not happen with the field section component. I feel like this needs to be resolved before this feature to give its full value.

    1. Hi Chris, The Dynamic Forms will only adjust the visibility of fields on the layout, it will not adjust the content. If you need to also adjust the content you could create a flow that would adjust the content based on the same criteria that adjusts the visibility on the layout.

  12. Hello Everyone,

    Can anyone please help me out in deployment of a Dynamic form from one Org to another?

    Thanks,
    Rahul

  13. Thank you for this! When I go to User Interface > Record Page Settings, Dynamic Forms aren’t listed as an option to toggle on. We’re using Lightning and are on Enterprise Edition… I wonder where I might be going wrong?

    1. Christine Marshall

      Reply

      Hi Julia,
      The official Salesforce instructions are:

      How: To enable Dynamic Forms in your org, from Setup, enter Record in the Quick Find box, and then click Record Page Settings. In the Dynamic Forms section, flip the switch to On.

      If you are unable to see this I recommend you post in the official chatter group: https://trailblazers.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000TyRh&s1oid=00D300000000iTz&s1nid=0DB30000000072L&emkind=chatterGroupMembership&s1uid=0053000000CU5hm&emtm=1587493482205&fromEmail=1&s1ext=0

      1. Hi Julia,

        A quick update for you. It seems Dynamic Forms no longer needs to be enabled. You can simply head to your custom Lightning record page and choose to upgrade!

        Best, Christine

  14. Gustavo Soares de Souza

    Reply

    Any of you able to deploy field sections and individual fields (with visibility conditions) from one org (sandbox) to a target org? For some reason, when I deploy the flexipage component, the field sections goes through, but individual fields added to the field sections are not going with. Is there a specific component type that I need to include on my deployment besides the flexiPage? I would appreciate if someone has been able to do that successfully. Thanks!

  15. Is it possible to use dynamic forms while creating a record rather than having to the edit the available record.

      1. Hi Christine,

        Thank you, My query is we can edit the page layout with dynamic forms after the record is created, for example lets assume Case object, i can dynamically change the section once Case record has been created, can this be done while creation of the record itself lets say based on a picklist value the form displays different sections.

        1. Christine Marshall

          Reply

          Hi Suresh,

          Changes made to the page layout using Dynamic Forms are applied to existing records and to the Create New screen. So, when creating a new record, you can choose to have fields dynamically appear based on the values of a picklist. In my org, additional fields appear if the Rating = Hot.

          1. Thanks Christine, I did end up trying this one on my org and it worked like a charm. Thank you very much.

    1. Christine Marshall

      Reply

      Hi Michelle,

      Not to my knowledge. It would be worth posting your question into the Trailblazer Group fro Dynamic Forms!

      Best, Christine

  16. Hi,

    We have created Dynamic Page forms for agreement object. Dynamic forms are working fine during creating & edit new agreement. But if we click the Apttus CLM Amend button, then edit page is coming in the form of standard page layout instead of dynamic Page form. Can you help me in this?

  17. Hello Christine,
    Is it possible to select parents fields from field section on child record page. Let say I am on contact record, can I have fields of related account record.

  18. Gireesh Jagadeeswaran

    Reply

    Hi Rahul/Jeremey,
    I know it is too late to answer. You can use “FlexiPage” component to deploy the changes. If you face challenges like fields not added in layouts but just the sections are visible on dynamic forms, try changing the API version of Package to 49.0 and above, retrieve and then deploy.
    Thanks
    Gireesh

  19. Rahul Mandwale

    Reply

    Hi Jeremy,

    Sorry it’s to late to reply,

    You can retrive it using the FlexiPage tag.

    For Example:
    Account_record_page
    FlexiPage

    And deploy using the same.

    Thanks,
    Rahul

  20. Is there a workaround to make sure that on EDIT it still displays all the fields that are part of the Record Details section ?

    1. Christine Marshall

      Reply

      Hi Kiran,

      As long as you have added all needed fields to a fields component, without any conditions, they will appear on Edit.

  21. Hi Jaclyn, In my experience whether you are creating a new record or updating an existing record, the conditional visibility of fields works if you have all 4 fields in your case within the same field section. If you fields spread out in multiple field sections, then it only works after you save the record.

  22. Works great for editing records – not so great for creating new records as of yet, since the field sections don’t evaluate until “Save.” Workaround is to have a fairly simplistic page visibility that forces users to create an initial record that will trigger what becomes visible. When they save, Salesforce will open the newly created record with the fields needed – they will then need to edit to fill in additional fields. This does make it a 2 step process – still potentially helpful, but requires sufficient user training/awareness. Else, continue to use page layouts or quick actions for record creation with specific fields.

Add Comment