Hiding five fields on one record type took a whole Dynamic Forms conversion

Installers kept seeing repair-only fields on new-construction Opportunities. Rather than a second page layout and profile layout assignments, the Opportunity Lightning record page was converted from force:detailPanel to Dynamic Forms, with a component visibility rule on {!Record.RecordType.DeveloperName}. How the layout was turned into flexipage:fieldSection facets, why the Account card failed validation with "missing required property [updateQuickActionName]" and then "Could not find quick action [Account._LightningUpdateAccount]", the GlobalValueSet default that changed three objects at once, and why the page layout stops mattering afterwards.

An installer opens a new-construction job and sees “Single Door Count”, “Affected Door Size” and “Existing Door Material”. Those fields mean something on a repair call, where somebody is describing a broken door that already exists. On a house that is still framing, there is no existing door. The fields are noise, and noise on a record page teaches people to stop reading it.

The ask was simple: hide five fields on one kind of Opportunity. The way it got done was not the way Salesforce usually suggests.

One layout, three record types

At Doorvana the Opportunity has three record types and one page layout serving all of them. The fields to hide on the Installation record type were the service-only ones:

  • Single_Door_Count__c, Double_Door_Count__c, Oversized_Door_Count__c
  • Affected_Door_Size__c
  • Existing_Door_Material__c

The textbook answer is a second page layout without them, plus page layout assignments by profile and record type. In a source-tracked org that means deploying the Profile to carry the assignments, and then maintaining two layouts that are identical except for five fields. They will drift. Someone adds a field to one and not the other, and the difference is invisible until a user on the wrong combination complains.

So the record page stopped using the layout for its fields.

From force:detailPanel to Dynamic Forms

The Opportunity Lightning record page showed its details with force:detailPanel, the Record Detail component, which renders whatever the assigned page layout says. Dynamic Forms replaces that with field sections that live on the record page itself, and each field can carry its own visibility rule.

The conversion was mechanical, which is the point. Each layout section became a flexipage:fieldSection pointing at a facet of flexipage:column components, and each column points at a facet of fieldInstance items, one per field. The layout’s Edit, Required and Readonly behaviors mapped onto each field’s uiBehavior. The result is four sections, About, Follow-Up, Status and History, with the same fields in the same order the layout had.

force-app/main/default/flexipages/Opportunity_Record_Page.flexipage-meta.xml (one section)

<flexiPageRegions>
    <itemInstances>
        <componentInstance>
            <componentInstanceProperties>
                <name>body</name>
                <value>Facet-opp-about-fields</value>
            </componentInstanceProperties>
            <componentName>flexipage:column</componentName>
            <identifier>flexipage_column_about</identifier>
        </componentInstance>
    </itemInstances>
    <name>Facet-opp-about-columns</name>
    <type>Facet</type>
</flexiPageRegions>
<!-- ... in the main region ... -->
<componentInstance>
    <componentInstanceProperties>
        <name>columns</name>
        <value>Facet-opp-about-columns</value>
    </componentInstanceProperties>
    <componentInstanceProperties>
        <name>label</name>
        <value>About</value>
    </componentInstanceProperties>
    <componentName>flexipage:fieldSection</componentName>
    <identifier>flexipage_fieldSection_about</identifier>
</componentInstance>

Then the five service-only fields each got the same component visibility rule:

force-app/main/default/flexipages/Opportunity_Record_Page.flexipage-meta.xml

<fieldInstance>
    <fieldInstanceProperties>
        <name>uiBehavior</name>
        <value>none</value>
    </fieldInstanceProperties>
    <fieldItem>Record.Single_Door_Count__c</fieldItem>
    <identifier>RecordSingleDoorCountField</identifier>
    <visibilityRule>
        <criteria>
            <leftValue>{!Record.RecordType.DeveloperName}</leftValue>
            <operator>NE</operator>
            <rightValue>Installation</rightValue>
        </criteria>
    </visibilityRule>
</fieldInstance>

Filtering on RecordType.DeveloperName rather than the record type Id keeps the rule identical in every org, and it survives a label rename. The sandbox dry run accepted the rule as written. That was the easy part.

It is the same move this project planned from the start for Accounts: fewer layouts, and field sections that show or hide on a value. The reasoning is in the post on record types versus picklists.

The Account card that needed an action nobody had

The same release put the Opportunity’s Account at the top of the right-hand column, so nobody has to scroll to find who the job is for. That is the console:relatedRecord component, the Related Record card, pointed at the Account lookup:

force-app/main/default/flexipages/Opportunity_Record_Page.flexipage-meta.xml

<componentInstance>
    <componentInstanceProperties>
        <name>lookupFieldName</name>
        <value>Opportunity.AccountId</value>
    </componentInstanceProperties>
    <componentInstanceProperties>
        <name>titleFieldName</name>
        <value>Account</value>
    </componentInstanceProperties>
    <componentInstanceProperties>
        <name>updateQuickActionName</name>
        <value>Account.Update_Account</value>
    </componentInstanceProperties>
    <componentName>console:relatedRecord</componentName>
    <identifier>account_related_record</identifier>
</componentInstance>

The first version had only the lookup, and production validation rejected it:

missing required property [updateQuickActionName]

The card has an edit button, and the edit button needs an Update quick action on the related object. The obvious move was the standard one’s name. Production rejected that too:

Could not find quick action [Account._LightningUpdateAccount]

There was no update action on Account in this org at all, standard or custom. So a small one shipped with the page: the four things someone fixing a builder’s details from a job would actually touch.

force-app/main/default/quickActions/Account.Update_Account.quickAction-meta.xml (excerpt)

<QuickAction xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Update Account</label>
    <optionsCreateFeedItem>false</optionsCreateFeedItem>
    <quickActionLayout>
        <layoutSectionStyle>TwoColumnsLeftToRight</layoutSectionStyle>
        <quickActionLayoutColumns>
            <quickActionLayoutItems>
                <field>Name</field>
                <uiBehavior>Required</uiBehavior>
            </quickActionLayoutItems>
            <quickActionLayoutItems>
                <field>Phone</field>
                <uiBehavior>Edit</uiBehavior>
            </quickActionLayoutItems>
            <quickActionLayoutItems>
                <field>Customer_Type__c</field>
                <uiBehavior>Edit</uiBehavior>
            </quickActionLayoutItems>
        </quickActionLayoutColumns>
        <quickActionLayoutColumns>
            <quickActionLayoutItems>
                <field>BillingAddress</field>
                <uiBehavior>Edit</uiBehavior>
            </quickActionLayoutItems>
        </quickActionLayoutColumns>
    </quickActionLayout>
    <type>Update</type>
</QuickAction>

One default, three objects

While the page was open, the Garage_Door_Material default went too. “Steel” was the default value, so new Opportunities started with it filled in.

The default is not on the Opportunity field. It lives on the GlobalValueSet that the Lead, Opportunity and Asset fields all share:

force-app/main/default/globalValueSets/Garage_Door_Material.globalValueSet-meta.xml (diff)

     <customValue>
         <fullName>Steel</fullName>
-        <default>true</default>
+        <default>false</default>
         <label>Steel</label>
     </customValue>

So clearing it for Opportunity cleared it everywhere. All three objects now start blank, and the service-lead screen flow, which had been preselecting the default, stopped doing that. Here that was the desired result. It is still not a per-field change, and it is easy to make thinking it is.

Removing the panel that only said no

Every record page also carried a Slack panel whose whole content was “Slack isn’t connected”. It came off the Account, Opportunity, Lead and Case pages in the same release. No record page has it now.

The whole change shipped as one manifest of four FlexiPages, the global value set and the quick action, validated with RunLocalTests, 72 of 72 passing, and quick-deployed.

The part that will catch someone later

After the switch, the Opportunity page layout no longer decides which fields appear in the details on desktop. The record page does. The layout still drives the highlights panel and the actions, so it is not dead, but anyone who has always added Opportunity fields by editing the layout will now make a change that does nothing.

That is the real cost of Dynamic Forms, and it is a people cost, not a platform one. It is written into the project’s working notes in bold: field changes on Opportunity go in the record page, not the page layout.

Practical summary

  • To hide fields on one record type, prefer a Dynamic Forms visibility rule on {!Record.RecordType.DeveloperName} over a second page layout and profile layout assignments.
  • Convert force:detailPanel mechanically: layout sections to flexipage:fieldSection, columns to flexipage:column facets, fields to fieldInstance with uiBehavior mapped from the layout.
  • console:relatedRecord needs updateQuickActionName, and the action must exist. If the org has none, ship an Update quick action with the page.
  • A GlobalValueSet default applies to every field and object bound to it, and to the flows that read it.
  • After the conversion, desktop field changes go on the record page. Write that down.

Filed under

Disclosure: Doorvana's owner is also a co-owner of Nocona Consulting. This is a real engagement between two separate companies, but not an arm's-length one — and not an independent reference. More on the work page.

FAQ

How do you hide a field on one record type without a second page layout?

Use Dynamic Forms on the Lightning record page and give the field a component visibility rule on the record type, for example {!Record.RecordType.DeveloperName} not equal to the record type's developer name. One record page and one layout then serve every record type, with no profile layout assignments to deploy.

What does "missing required property [updateQuickActionName]" mean on a FlexiPage deploy?

A console:relatedRecord component (the Related Record card) was deployed without the update quick action it uses for its edit button. Add the updateQuickActionName property naming an Update quick action on the related object. If the object has no such action, the deploy then fails with "Could not find quick action", and you have to create one.

Why does "Could not find quick action [Account._LightningUpdateAccount]" appear?

The FlexiPage referenced a standard update action name the org does not have. In this org Account had no update quick action at all, so a small custom one of type Update, with the fields the card should edit, was deployed alongside the record page and referenced as Account.Update_Account.

After converting to Dynamic Forms, why do page layout changes no longer show up?

Once a Lightning record page uses Dynamic Forms field sections instead of the Record Detail component, the fields shown on desktop come from the record page. The page layout still drives things like the highlights panel and actions, but adding or moving a field on the layout no longer changes what users see in the details. Edit the record page instead.

Does changing a global value set's default affect every field that uses it?

Yes. The default lives on the GlobalValueSet, not on the field, so clearing it changes the default for every picklist field bound to that value set on every object, and for anything that relied on it, such as a screen flow that preselected the default.

Working on something like this?

I can tell you what it takes.

If you run a home services business and this looks like a problem you have, book a call and we will talk through it.