In the latest release Salesforce finally let us to migrate fields and sections from page layout to any place on the record page as individual components. This of course means, that you can set visibility of those fields and sections individually. Unfortunately it all works on Custom Objects only… Or not? Though Dynamic Forms really work just on Custom Objects, I will show you easy workaround for Standard Objects.
In the tutorial we will display Shipping Address on Account in the right region aside from the rest of the record. To accomplish this we will use Lightning App Builder to create new Record Page for Contact object and quick action to create custom section layout. For this interesting idea I would like to thank my colleague Emma Peeters, who introduced the workaround on my recent project.
Update Account page layout
First we will remove the Shipping Address Section from Page Layout on Account Object.
- Go to Object Manager → Account → Page Layouts → Account Layout and remove Shipping Address altogether.
Create Quick Action
This is the core of our workaround. We will use quick action to create layout from fields we want to display in separate component. When we are done, we will just place it on Record Page.
- Go to Object Manager → Account → Button, Links and Actions
- Create New Action
- Action Type: Update a record
- Standard Label Type: None
- Label: Shipping Address
- Name: ShippingAddress
- 3. Place Shipping Address on the layout
Create Record Page in Lightning App Builder
We’ve created our “Dynamic Form” as a Quick Action and now we need to display it. For the purpose of our tutorial, we will use right column.
- Open any Account
- Click on the Gear icon in the top right corner and select Edit Page
- Search for Related Record in the Standard Component List
- Add the component to the right region and configure it
- Header Label: Shipping Address
- Lookup Field: Use This Account
- Update Action: Shipping Address
- Create Action: Empty
Our job is done! Make it useful now and never discuss this (or anything else) on the Clubhouse.
Looking for an experienced Salesforce Architect?
- Are you considering Salesforce for your company but unsure of where to begin?
- Planning a Salesforce implementation and in need of seasoned expertise?
- Already using Salesforce but not fully satisfied with the outcome?
- Facing roadblocks in your Salesforce implementation and require assistance to progress?
Feel free to review my profile and reach out for tailored support to meet your needs!
This also works for communities ??
ReplyDeleteCan we configure same for communities?
I want display specific section for based on drop down picklist .using above case it could possible by setting component visibility based on drop down picklist value.
But not able to do same for communities /Do you have any suggestion??
TIA
Hello, sorry for late reply. In communities your hands are definitely tied. The only solution to cover both requirements are to build custom LWC. You simply take lightning-record-form component and wrap it into the component, that would expose: a) API names of the fields to be displayed b) number of columns c) conditions, when the block should be displayed.
DeleteThis comment has been removed by the author.
ReplyDeleteHI Jain,
ReplyDeleteThis is Not working in case of Lookup Fields( In community).
Lookup Fields show the record Id value not the name of record.
Great post on forms on salesforce , keep posting more. wanted to learn salesforce course then visit: Salesforce Classes In Pune
ReplyDelete