Skip to main content

Dynamic Forms on Salesforce Standard Objects

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.

  1. Go to Object ManagerAccountPage LayoutsAccount 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.

  1. Go to Object ManagerAccountButton, Links and Actions
  2. Create New Action
    • Action Type: Update a record
    • Standard Label Type: None
    • Label: Shipping Address
    • Name: ShippingAddress
  3. 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.

  1. Open any Account
  2. Click on the Gear icon in the top right corner and select Edit Page
  3. Search for Related Record in the Standard Component List
  4. 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!

Comments

  1. This also works for communities ??
    Can 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

    ReplyDelete
    Replies
    1. 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.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. HI Jain,

    This is Not working in case of Lookup Fields( In community).
    Lookup Fields show the record Id value not the name of record.

    ReplyDelete
  4. Great post on forms on salesforce , keep posting more. wanted to learn salesforce course then visit: Salesforce Classes In Pune

    ReplyDelete

Post a Comment

About author

My photo
Jan Binder
Experienced Salesforce Technical Architect and Team Lead with a proven track record of delivering successful enterprise projects for major global companies across diverse industries, including automotive, oil & gas, and construction.