Add a Compare action button
  • 25 Apr 2023
  • 1 Minute to read
  • Dark
    Light

Add a Compare action button

  • Dark
    Light

Article summary

To add and enable a Compare action button, you must:

Create a Lightning component

  1. Go to Developer Console > File > New > Lightning Component.

  2. In the New Lightning bundle dialog, in the Name field, enter a custom name for your component.

  3. Select Submit.

  4. Replace the .cmp markup file with the following:

    <aura:component access="global"
    implements="force:lightningQuickActionWithoutHeader,force:hasRecordId">
                                                                                      
        <zpl:ScenarioCompareAction scenarioConfigurationNickname="<Unique Nickname of the Scenario Configuration>"
             recordId="{!v.recordId}"/>
    
    </aura:component>
    
  5. Replace the value for the Unique Nickname of the Scenario Configuration attribute with the nickname of the scenario configuration you want to use.

  6. Save the component.

Create the Compare action button

  1. From the Setup interface in the customer's org, go to Object Manager and select your header object.
  2. In the Buttons, Links and Actions section, select New Action.
  3. In the Label and Name fields, enter Compare.
  4. From the Action Type dropdown, choose Lightning Component.
  5. From the Lightning Component dropdown, choose the name of the component you created in Create a Lightning component.
  6. In the Height field, specify 250px.
  7. Select Save.

Drop the action button on the object layout

  1. Go to Page Layouts for this object and select a layout.
  2. In the Mobile & Lightning Actions section, find the Compare action button.
  3. Drag it to the correct place in the layout.
  4. Select Save.

Add the action button to the Lightning record page

If the Lightning record page is using dynamic forms, you must also add the action to the Lightning record page.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.