Skip to content

Create Dynamic Forms in Salesforce with Clicks

    When working on classic page layout, which drives the detailed page component on the Lightning record page, it comes with a few limitations, for example:

    1. Display a Section Invoice Payment once and Invoice is sent. I know, you gonna say we can use record type & another page layout – too much – It should be easy.
    2. Display field Invoice sent Date (that is populated by Flow) once invoice status is sent – same solution as above.

    Above are such examples; there are many more. A Salesforce professional life should be easy, and Salesforce is making it with every release.

    Introducing Dynamic Forms that allow you to show the fields and sections on the lightning record page based on conditions. You can configure them like other components on the page and give the users only fields and sections they require.

    It gives you the ability to show and restrict data based on conditions with a single page layout for different users; as of now, it is available only for custom objects.

    Let’s Create a Dynamic Form

    1. Navigate to Cusotm object (Lightning page), Select Record Detail tab.
    2. Click on gear icon | Edit Page
    3. Select ‘Record Detail‘ or ‘Highlights Panel‘ and
    4. Click on Upgrade Now and Save it once you done.

    Now you can modify the record details page as per your requirement!

    1. Click on Fields.
    2. Drag and drop Field Section after Information.
    3. Lable the Field Section name as ‘Tour Documents’.
    4. Drag and drop document fields from fields panel to Tour Document section.

    You can also add conditions to show/hide fields!

    1. Click and select Start Date field under Information field section.
    2. Click Set Field Visibility and Add Filter.
    3. Select Filter Type: Record Field
      1. Field: Destination
      2. Operator: Not Equal
      3. Value: Ukraine
      4. Click Done
    1. Follow step 9 to 11 by selecting Finish Date field.
    2. Click Save and Actvation.
    3. Select Org Default | Click on Assign as Org Default.
    4. Select Desktop option | Click Next and Save.

    Points to Remember

    1. Dynamic Forms is supported on record pages for custom objects only.
    2. If it is a universally required field, you can not edit the field’s properties in the Lightning App Builder property panel.
    3. Fields marked as Required or Read-Only on a page layout retain that state into Dynamic Forms-based page.
    4. Remember to include Required fields on your Lightning pages to allow users to Create, Edit or Clone a record.
    5. If the visibility rule hides the field, a new or changed field value will not save on the page.

    Check more tips and limitations.

    You are Done!!!

    I would love to hear about your experience with Dynamic Forms. How do you use it?

    Leave a Reply