Configuring Layouts Rules

Configuring Layouts Rules

Layout rules let you make your module's forms dynamic by showing or hiding fields, sections, and subforms, enforcing mandatory fields, or triggering messages and buttons - all based on specific conditions you define. Instead of presenting users with a static, one-size-fits-all layout, you can configure the form to adapt in real time based on the values entered, ensuring users only see what's relevant to their current context.

Each layout rule is built around criteria (conditions based on field values) and one or more actions that execute when those criteria are met. This lets you simplify complex forms, guide users toward correct data entry, and reduce clutter by surfacing fields and sections only when they're actually needed.

Create layout rules  

To create layout rules
  1. Click the more icon (...) for the required module in the sidebar and select Layout Rules.



    Alternatively, go to  Setup > Customization > Modules and Fields. From the list of modules, select the required module and then the layout. Go to the Layout Rules section. Click New Layout Rule.



  2. In the New Layout Rule popup, enter the following details:

    1. Enter a name for the rule.
    2. Describe the rule.
    3. Choose a primary field that controls this rule. Example, Application Status.
    4. Choose a condition to initiate the rule. Example, Application Status is Draft.
    5. Click Next.



  3. In the Rule page, the Condition specified is prepopulated. So click Trigger an action.
  4. Choose from the list of actions. Example, Show Section.
  5. In the Create Action right pane, specify the section to be shown. In this scenario, it's the Credit Evaluation section.
  6. If you have further conditions and actions, you can specify them as required similarly.

Result of the layout rule  

Now when you create a lead in the Loan Application layout, the Credit Evaluation section is displayed only when you select Application Status as Draft. Otherwise, it is hidden.

Actions that can be triggered   

There are multiple actions that can be triggered when layout rule criteria are met.

Field Actions

Show Fields -
Choose this action when you want specific fields to be shown only when the prescribed criteria are met.



Set Mandatory Fields - Choose this action when you want to make a few fields mandatory only when the prescribed criteria are met.



Show Picklist Values - Choose this action when you want to narrow down picklist options based on context.

NotesNote. The picklist options configured will be shown when conditions match. Options that are not configured will always be shown. This action supports both picklist and multi-select picklist field types.



Set Read Only Fields - Lock fields from editing once a condition is met. 



Set Field Value - Choose this action when you want to automatically populate a field's value when conditions are met.

NotesNote. The value will be set when conditions match. The user can change the value manually or via the 'Reset Value' option and the system won't automatically set back the configured value. The next execution for this action takes place if the condition changes and matches again.



Recommend Field Value - Choose this action when you want to suggest a value for a field through a contextual message.

Notes
Note. If the recommendation is ignored (Not Accepted or Canceled) by the user when it is shown in the form, it will be retained as an icon next to the field. Execution is similar to Set Value.



Show Message - Choose this action when you want to display a timely, contextual message for a field when a condition is triggered.



Other Actions

Show Sections - Choose this action when you want specific sections to be shown only when the prescribed criteria are met.



Show Subforms - Choose this action when you want the subform to be shown only when the prescribed criteria are met.



Show Related Lists - Choose this action when you want surface relevant related lists based on the current record's context.



Show Buttons - Choose this action when you want to display action buttons that are relevant to the current state of record.

Notes
Note. Only Custom Buttons are supported. The custom buttons in Create/Clone, Edit and Details pages are supported.



Show Links - Choose this action when you want to surface helpful reference links when a specific condition is met.



Verify Fields - Choose this action when you want to prompt the verification of critical fields before proceeding.
Notes
Note. The order of the fields to be verified can be set in the configuration. Execution similar to Set and Recommend Value.  



Notes

Notes.

  • Date and Date Time values, can set values based on other data and date time fields.

  • Calculations for data and date time fields in set and recommend value actions will be based on the org time zone.

  • Set Value, Recommend Value and Verify Details will be executed only when the condition is directly matched by a user in the interface. If it is matched via other instances such as by the system via automation field updates or data entering from Import, it won't be triggered.

  • The field set as the primary field for a layout rule, can further be included in the Show Field and Set Mandatory Fields actions. For instance if a rule is based on a primary field Type of Vehicle,  a newly created layout rule Vehicle Insurance can show or set the field Type of Vehicle as mandatory during the configuration.

  • The picklist values shown will be filtered first based on map dependency fields if they are configured and then based on the show picklist values action.

  • The same field cannot be used in the Set Mandatory Fields and Set Read-Only Fields actions for the same condition.

  • The same field cannot be used in the Set Value and Recommend Value actions for the same condition.

  • Unique fields cannot be used in the Set Value and Recommend Value actions. Fields configured in Set Value and Recommend Value actions cannot be marked as unique.

  • Only custom buttons are supported in the Show Buttons action.

  • Integration related lists are not supported by the Show Related Lists action.


Profile-based Execution  

Layout rules can now be configured to run for specific user profiles only. When setting up a rule, you can choose exactly which profiles it should apply to, so the same module can show different layout behavior for different teams. For example, a rule that makes a field read-only can be limited to one profile, while every other profile continues to see that field as editable.

Notes

Notes.

  • Profile based execution is supported for Show Fields, Show Picklist Values, Set Read Only Fields, Recommend Field Value, Show Message, Show Subforms, Show Sections, Show Related Lists, Show Buttons, Show Links.

  • For profile based execution for show actions, the entity will be shown only for the selected profiles. For set-read only fields action, the chosen fields will be available for edit for the selected profiles.



Interactive Preview  

Once you have configured and saved a Layout Rule, you can preview its execution before it goes live - all without leaving the rule configuration page.

The preview panel on the left lists all the conditions configured in your rule. Selecting a condition highlights exactly what it triggers on the layout - fields, sections, or subforms that get hidden, shown, marked read-only, or marked mandatory - so you can see the effect of each condition in isolation.

Since a rule can behave differently across profiles, you can also switch profiles from within the preview. Selecting a different profile re-runs the same condition against that profile's view, instantly updating the layout to reflect what a user belonging to that profile would see when viewing or editing a record. This lets you confirm that the right sections, fields, and subforms appear (or stay hidden), and that mandatory settings apply as intended, for every profile the rule affects.

This is especially useful for complex rules with multiple conditions and profile-specific behavior, as it lets you catch configuration errors on the spot rather than after the rule is live.



Recommend Field Value, Set Mandatory Fields, and Verify Fields all work together to guide accurate data entry when a layout rule's conditions are met. Set Mandatory Fields forces the user to fill in specific fields before they can proceed, Recommend Field Value suggests a value via a contextual message (which the user can accept, ignore, or later reset - if ignored, it stays as an icon next to the field), and Verify Fields prompts the user to confirm critical field values before saving, in a defined order if multiple fields are set for verification.



Alert
Execution order and behavior
  1. If a layout rule uses the same field in the Set Value action across multiple conditions, and more than one of those conditions matches at the same time, the value from the topmost matching condition will be applied to the field. The same logic applies to the Recommend Value and Show Message actions.
  2. When layout rules run, the Set Value action always executes last.
  3. The Set Value action only applies to fields and picklist values that are visible in the interface at the time of execution.
  4. If a field is read-only due to permissions or the Set Read-Only Fields action, the Set Value action can still update it when triggered. However, recommendations will not be shown for read-only fields.
  5. Picklist values are filtered first by the Map Dependency Fields action, and then further filtered by the Show Picklist Values action.
  6. During a blueprint transition form, only the Set Mandatory Fields action is executed. Other actions do not run.
Idea
Pop-ups and Field Verification
  1. If a layout rule is triggered by editing a field on the details page, the fields configured under Set Mandatory, Set Value, and Recommend Value actions will appear in the Review Details pop-up. If the Verify Fields action is also triggered, its pop-up will appear after the Review Details pop-up.
  2. The Recommend Field Value and Verify Fields actions are executed at the org level. Once a user accepts or cancels a recommendation, or is shown a Verify Details pop-up, that same pop-up will not be shown to another user.
  3. If multiple Verify Fields actions are triggered, they will all appear in a single pop-up. Changes made to field values within the Verify Fields pop-up will trigger other actions, but not another Verify Fields pop-up. This means that changes within one Verify Fields pop-up won't re-trigger the Verify Fields action itself.
  4. When you edit a primary field used in a layout rule, if there are mandatory fields associated with the rule, these mandatory fields will be captured via a pop-up prompt.
    Example: if a rule states "If Amount > 50,000 USD, make Discount mandatory," editing the Amount field from the Record Detail page will prompt the Discount field via a pop-up.
  5. If a layout rule is configured based on a Deal Stage, editing the stage from the Detail page, Blueprint, or Pipeline view will capture the fields mandated by the rule via a pop-up.
  6. If a layout rule mandates a field based on Task Status (e.g., Description is mandatory when a Task is Closed), closing a task from the Activities related list, Kanban view, Home page, or a custom view will trigger CRM to verify the rule and prompt for the mandated fields before closing.
  7. Layout rule support extends to Kanban view, so drag-and-drop actions will evaluate layout rules.
  8. Layout rules are also effective on approval of records.
Info
Read-only and mandatory field handling
  1. If a layout-mandatory or layout-rule-mandatory field is locked with an empty value via the Set Read-Only action, it will be unlocked upon save and the user will be prompted to enter a value.
  2. The Set Read-Only Fields action locks fields only on pages where layout rules are executed. Values in these fields can still be updated through Mass Update, Import, automated system updates, APIs, and integrations.
  3. In Kanban View, if the field used for categorization is locked via the Set Read-Only Fields action, the record cannot be moved to a different category.
Quote
Field type calculations
  1. For date and date-time fields, Set Value and Recommend Value calculations are based on the organization's time zone.
  2. For currency fields, the value configured in the Set Value or Recommend Field Value action is always treated as the Home Currency value. On execution, it is converted to the record's currency using the record's exchange rate.
Notes
Scope, restrictions, and availability
  1. Layout Rules are applied on Create, Edit, and View pages.
  2. Layout rules are not available for records generated via import, webforms, or the lead convert page. When creating or editing records via APIs, only the Set Mandatory Fields action is supported.
  3. The [Record] Owner field currently cannot be chosen as the primary field that controls the layout rule.
  4. Layout rules cannot be created based on a Multi-select Picklist field as the primary field.
  5. Layout Rules cannot be used on the following field types:
    1. Auto Number
    2. Lookup
    3. User Lookup
    4. Formula
    5. File Upload
    6. Multi Line
    7. Multi-select Picklist
  6. The Show Subform trigger action is available only if a subform is present in the chosen layout.
Layout Rules created from extensions: For layout rules created from extensions, the users with module customization permission can view the rule and update the status. Editing and Deleting the rule is restricted.

Warning
Limits:
  1. Maximum rules allowed - 10 per layout
  2. Maximum parent conditions allowed - 25
  3. Maximum branch conditions allowed - 5 per parent condition
  4. Maximum branch conditions criteria allowed - 5 per branch condition
  5. Maximum actions allowed - 25 per branch condition
  6. In a layout rule, in set value and recommend value actions combined, only 5 multi-line small fields can be used.

Layout Rules - Exceptions

While Layout Rules are effective on creating a record manually, when a field used in a layout rule is updated through other ways such as Workflow update, and APIs, the field update takes precedence over both these rules.
Example:  
You have a layout rule for the Leads module that says,

If Lead Source is Tradeshow, make the Email address mandatory.

This layout rule will work when you manually create or edit a record in CRM and update the Lead Source to Tradeshow. However if the Lead Source is updated as Tradeshow via the following means, Email address will NOT be made mandatory and as a consequence, the Email address field value will be empty.

Means of field update in CRM
Field update details
Import
Updated on importing new leads or overwriting existing records
Workflow rules
Updated as a result of workflow action
APIs
Updated via API updateRecords method
Mass update
Primary field that has been used in a layout rule with the condition as "Set mandatory" will not be available for mass update.
Macro
Layout rule primary fields are not listed in Macros and cannot be updated through a Macro.