How To: Run Super Clone Pro from Batch Apex
October 26, 2018
How To: Show a list of records to select from with the Super Clone Pro Copy page
April 1, 2019

How To: Create a Quick Action Lightning Component for Super Clone Pro

URL custom buttons can be used for both Salesforce Classic and Lightning. However, sometimes extra logic or validations need to be added before the Super Clone Pro page is loaded. In Classic, this could be done with a Javascript custom button. In Lightning, we need to use a different approach because Lightning doesn’t support Javascript buttons. Below is an example of how to use a Lightning Component in a Quick Action that will first check a value on the record and then load the Super Clone Pro page.

First, we will create a new Lightning Component. An attribute is added (force:lightningQuickAction), so it can be used in a Quick Action. A second attribute is added (force:hasRecordId), so it receives the record Id for the record’s page. The markup uses the Lightning Data Service to retrieve information from the record that we will use in our logic, and a message block that will display if the user should not load the Super Clone Pro page.

Next, create a Controller for the Lightning Component. This is where we will write Javascript logic to determine if the record should be cloned or not.

Finally, navigate to the Object’s “Buttons, Links, and Actions” setup page. Click the “New Action” button. Select “Lightning Component” in the “Action Type”. Then the name of the Lightning Component that we created should display in a list of available Lightning Components.

You will now be able to add this Action to the page layout that is used in the Lightning Experience. 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.