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:
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.
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
Navigate to Cusotm object (Lightning page), Select Record Detail tab.
Click on gear icon | Edit Page
Select ‘Record Detail‘ or ‘Highlights Panel‘ and
Click on Upgrade Now and Save it once you done.
Now you can modify the record details page as per your requirement!
Click on Fields.
Drag and drop Field Section after Information.
Lable the Field Section name as ‘Tour Documents’.
Drag and drop document fields from fields panel to Tour Document section.
You can also add conditions to show/hide fields!
Click and select Start Date field under Information field section.
Click Set Field Visibility and Add Filter.
Select Filter Type: Record Field
Operator: Not Equal
Follow step 9 to 11 by selecting Finish Date field.
Click Save and Actvation.
Select Org Default | Click on Assign as Org Default.
Select Desktop option | Click Next and Save.
Points to Remember
Dynamic Forms is supported on record pages for custom objects only.
If it is a universally required field, you can not edit the field’s properties in the Lightning App Builder property panel.
Fields marked as Required or Read-Only on a page layout retain that state into Dynamic Forms-based page.
Remember to include Required fields on your Lightning pages to allow users to Create, Edit or Clone a record.
If the visibility rule hides the field, a new or changed field value will not save on the page.