Salesforce allows users to create a record by making a copy of a similar record using its Clone action. When cloning a record which has address, email or phone fields which have been validated by EDQ components the associated EDQ Log records need to be cloned too. This ensures the cloned record also displays the validation status of those fields. To support this, our application offers a Lightning Web Component which can be used in a custom action.

Configuring the custom action

As an example, here are the steps for adding the custom clone action to the Contact object.

  1. Make sure the Edit button for Contact has been overridden with the EDQ Lightning component as detailed on the New and Edit button override page.

  2. Within Object Manager for Contact select Buttons, Links and Actions from the left menu.

  3. Click New Action in the top right.

  4. Provide the following mandatory details and then click Save:

    Field Specification
    Action Type Lightning Web Component
    Lightning Web Component TExperianLEDQ:ledqCmpCloneBtn
    Label A label for the button chosen by the user
    Name A unique API name for the button chosen by the user
  5. Return to Object Manager for Contact and select Page Layouts from the left menu.

  6. Select your chosen layout, for example Contact Layout.

  7. From the Contact Layout panel at the top select Mobile & Lightning Actions.

    Mobile & Lightning Actions

  8. Drag the action you created in the earlier step to the desired position in the Salesforce Mobile and Lightning Experience Actions section beneath.

  9. Click Save at the top.

  10. If you now browse to a Contact record you will find the new action button in the top right.

Cloning behavior

The custom clone action differs from the default Salesforce clone button. The default behavior is to display an edit modal for the cloned record prior to creating it. Instead, our custom clone action first asks for confirmation before going ahead and cloning the record along with any validation statuses.

Clone Record confirmation

Once the clone has been created, a confirmation message is shown which allows the user to navigate to and view the cloned record where they can make any necessary edits.