User Guide: Dynamic Path Component

What is the Dynamic Path Component?

The Dynamic Path component enhances standard Salesforce Path functionality and offers greater customizability for your business processes. It allows for grouping path values, displaying key fields dynamically, and providing tailored guidance.

Step-by-Step Setup

The Dynamic Path Package comes with preconfigured paths for Opportunity and Lead objects. You can also easily customize paths for any Standard or Custom object following these steps.

1. Create Dynamic Path Config Records (Required)

  1. Navigate to Setup > Custom Metadata Types.
  2. Click Manage Records next to "Dynamic Path Config".
  3. Click New.
  4. Fill in the required fields:
    • Label (Required): Provide a unique name (e.g., Opportunity Path).
    • Field API Name (Required): Enter the API name of the picklist field used for the path (e.g., StageName).
    • Object API Name (Required): Specify the API name of the Salesforce object (e.g., Opportunity).
  5. Click Save.

2. Create Dynamic Path Value Config Records (Optional)

Creating these configurations is optional. Only create them if you need to customize the behavior or appearance of specific values within your path (e.g., grouping, key fields, guidance).

  1. Navigate to Setup > Custom Metadata Types.
  2. Click Manage Records next to "Dynamic Path Value Config".
  3. Click New.
  4. Fill in the fields as needed:
    • Label (Required): Enter the exact API name of the picklist value (e.g., Prospecting).
    • Dynamic Path Config (Required): Select the corresponding Dynamic Path Config record created in step 1 using the lookup.
    • Group Label (Optional): Enter a label to group this value with others under a common heading in the path.
    • Key Fields (Optional): Provide a semi-colon separated list of field API names (up to five) to display when this path value is active (e.g., Amount;CloseDate).
    • Guidance Body (Optional): Enter rich text guidance to display for this path value.
    • Is Closed (Optional): Check this box if this value represents a "Closed Won" or equivalent terminal success state.
    • Is Lost (Optional): Check this box if this value represents a "Closed Lost" or equivalent terminal failure state.
  5. Click Save. Repeat for other values needing customization.

3. Add the Dynamic Path Component to a Record Page

  1. Navigate to a record page of the object you configured (e.g., an Opportunity record).
  2. Click the Setup gear icon in the top right and select Edit Page.
  3. In the Lightning App Builder, find the Dynamic Path component under the "Custom" components section on the left panel.
  4. Drag the Dynamic Path component onto the desired location on your page layout (often near the top).

4. Configure the Component Properties

Once the component is placed on the page, click on it to configure its properties in the right-hand panel:

  • Dynamic Path Configuration (Required): Select the specific "Dynamic Path Config" record you created in Step 1 from the dropdown list. This tells the component which path to display.
  • Path Type: Choose "Linear" (standard progression) or "Non-Linear" (allows moving back and forth more freely, appearance might differ slightly).
  • Hide Path Button: Check this box if you want to hide the "Mark Stage as Complete" (or similar) button.
  • Path Button Custom Text: If the button is not hidden, you can enter custom text for it here (e.g., "Update Status").
  • Has Guidance: Check this box to enable the display of guidance text defined in the "Dynamic Path Value Config" records.
  • Remove Check Mark on Completed: By default (unchecked), completed stages show a checkmark. Check this box to remove the checkmark icon from completed stages.

After configuring, click Save in the Lightning App Builder. You may also need to click Activate to assign the updated page layout to the relevant profiles or apps.

Important Tips

Save and Activate: Always remember to Save your changes in the Lightning App Builder and Activate the page if necessary.

Testing: Test thoroughly in a Salesforce Sandbox environment before deploying to Production.

Picklist Fields: The component is primarily designed to work with picklist fields.

Value Configs: Dynamic Path Value Config records are only needed if you want to customize specific path values (grouping, key fields, guidance, closed/lost status).

No Duplicates: Ensure you don't create duplicate Dynamic Path Value Config records for the same picklist value within the same Path Config.

Key Fields Usage: Use the "Key Fields" feature strategically to prompt users for critical information at specific stages.

Guidance Rich Text: The "Guidance Body" field supports Salesforce Rich Text markup for formatting.

Apex Class Permission: If the package was initially installed for 'Admins Only' and later reinstalled for 'All Users', you might encounter an issue where the necessary Apex classes are not automatically added to non-admin profiles; therefore, manually add "DynamicPathController" and "DynamicPathConfigsList" to Apex Class Access in profile or a permission set (thanks to Jimmy Martin)