Salesforce UI configuration has been straight forward -
- Create a
Page Layoutfor an object (and assign that to profiles/permission sets)
- Add button/action link/other controls to layout
- Add fields
Salesforce shows the “proven”, “battle tested”, two-column layout for the fields and that was that. You control who sees what primarily through layouts.
Lightning UI brought a few modern elements to the mix (e.g. you can have nicer looking headers, more elements, and the works), but the basic layout remained the same. You still rely on the layout for the finer details of showing the controls.
For e.g. let us say sales and service departments create new accounts in an org, but enter different details while creating the account. We personalise the user experience by -
Account Sales Layoutand
Account Service Layout
- Provide different controls in each layout
- Assign them to Lightning record pages
You control how different users see the specific layouts through the layout assignment or assignment of lightning record pages to specific profiles.
While this works, we have -
- Complexity in creating different layouts for the same purpose
- Additional maintenance
All that will change with dynamic forms. Available for custom objects in Winter ‘21,
Dynamic Form and
Dynamic Action features bring the much needed “dynamic” behaviour to controls (buttons & fields). You can now conditionally show controls based on profiles on a single form.
Enabling a dynamic form is simple -
- Go to a specific lightning record page
- Click on the
- Click on the button to upgrade to dynamic form
- Choose a specific layout to upgrade and create a dynamic form
Once done you will be able to select individual buttons, action links or fields and set attributes on them -
- Make fields read-only
- Make fields visible based on users or permissions
- Enable field visibility to be affected by record data value
In this new world -
- You can make controls appear or disappear based on users, permissions or record-level data without duplicating layouts
- You can also use this arrangement to specify read-only or required at the UI level
You would have taken note that the field-level permissions extend the component-level permissions available at the lightning component level within the record page. You can show or hide entire section with the same filters.
Also take note there is no “downgrade” button to go back to the old world. But, you can always delete sections / add the
Detail component back to stop using dynamic forms.
The UI dynamic form behaviour looks quite basic at this time, but I am happy about the direction of Salesforce UI configuration. I look forward to the functionality getting more focus and enhancements as we get into future releases - all while simplifying implementation and maintenance requirements. At this time I am happy to recommend dynamic forms for the most basic UI functions for an existing layout in custom objects. I would continue creating layouts for anything more complex for now.