Skip to main content

Salesforce Dynamic Forms & Dynamic Actions Setup Guide

Dynamic Forms breaks the Record Detail component on your Lightning pages into individual field and section components that you can put anywhere on the page, including in separate tabs and accordion sections. You can use visibility rules to show your end users only the fields they need to see, when they need to see them.

1. Custom Dynamic Forms Configuration

Instead of standard Salesforce out-of-the-box Dynamic Forms, this setup utilizes custom components to provide modular, secure layouts.

1.1 Components Overview

  • InCountry Dynamic Form Section: A container component that hosts individual fields.
  • InCountry Dynamic Form Field: Individual field components that must be linked to a parent section.

1.2 Step-by-Step Configuration

  1. Navigate to Target Record: Open any record of the target object in Lightning Experience.

  2. Launch App Builder: Click the Setup Gear icon (top-right) and select Edit Page.

  3. Add Sections:

    • Locate the custom InCountry Dynamic Form Section component in the left-hand palette.

    • Drag and drop the component onto the canvas.

    • Configure Section Properties:

      • Section Id: Enter a unique numeric identifier (e.g., 1 for the first section on the page). This ID must be unique across all sections on the page.

      • Section Name: Enter the desired display name for the section.

  4. Add Fields:

  • Locate the custom InCountry Dynamic Form Field component in the left-hand palette.

  • Drag and drop the component onto the canvas (can be placed anywhere on the page).

  • Configure Field Properties:

    • Section Id: Enter the ID of the parent section this field belongs to. Fields are rendered inside their parent sections, so establishing this relation is mandatory.

    • API Name: Enter the exact API name of the target Salesforce field.

note

Field ID within the same Section must be unique. If multiple fields belonging to the same section share the same ID, which may cause data to display incorrectly.

1.3 Visibility Rules

Visibility filters can be defined at both the section and field levels. Select the respective component on the canvas and click Add Filter under the visibility settings in the right-hand properties pane.

  • Record Field Filter: Evaluates current record fields (e.g., showing Loss Reason only when Stage = Closed Lost). The layout updates instantly when edits are made directly via the custom InCountry Record Detail or InCountry Dynamic Form Section components. Changes made via external APIs or standard out-of-the-box components require a page refresh.
  • Device Filter: Evaluates the user's active device category (Desktop / Phone). Note that changing device simulation or user agent settings requires a page refresh.
  • User/Advanced Filter: Evaluates active user attributes (such as Profile or Role). Modifying active user attributes requires a page refresh.

2. Custom Dynamic Actions Configuration

With dynamic actions, you can add flexibility and control to actions on your record pages. Assign dynamic actions in the Lightning App Builder instead of in the page layout editor, and then apply filters to control when and where actions are visible to users.

2.1 Step-by-Step Configuration

  1. Identify the Header: Ensure the InCountry Highlights (Header) component is placed on the canvas. Click on this component and check the Use Dynamic Actions checkbox in the right-hand properties pane to enable custom action processing.

  2. Add Action Components:

    • Locate the custom InCountry Dynamic Action component in the custom components section.

    • Drag and drop the component onto the canvas (each instance of this component represents a single action button).

  3. Configure Action Properties:

    • Select Action: Choose the desired Quick Action or standard action from the properties pane.

    • Order: Set a numeric value to define the rendering order of the button on the Header component.

note

If the Order field contains duplicate values, the correct display sequence of actions is not guaranteed.

note

If the currently selected Quick Action is not supported by the organization or the current object, it will simply not appear in the Record Header. This is standard Salesforce behavior.

2.2 Visibility Filters

Select the specific InCountry Dynamic Action component on the canvas and click Add Filter to configure conditional display logic.

  • By Record Field: Displays the action based on record field criteria (e.g., showing Close Deal only if IsClosed = False). Quick actions update dynamically when records are modified using InCountry Record Detail or InCountry Dynamic Form Section.

  • By User Profile/Role: Limits action availability based on administrative or operations profiles. Changes to user profiles or roles require a page refresh to apply.

  • By Device: Shows specific actions depending on device type (e.g., showing Log Mobile Call only when Device = Phone). Adjusting active device types requires a page refresh.