How To: Create a Quick Action Lightning Component for Super Clone Pro
January 14, 2019
How To: Add CSS Style to the Clone, Edit, and Copy pages
June 2, 2019

How To: Show a list of records to select from with the Super Clone Pro Copy page

The Super Clone Pro copy page allows you to copy related lists from one parent record to another parent record. The page has lookup field that lets you select the new parent record. This uses Salesforce’s default popup window to select a new record. This default search may show too many records.

The following code is an example of how to display a filtered list of possible records to choose from. The page allows the user to click on the row to make their selection.

The required custom components include a Visualforce page, Apex controller extension, and Apex test class. The Apex controller extension contains logic to select the appropriate records. The Visualforce page displays the list, and it uses jQuery to set the value for the lookup field in the Super Clone Pro component.

oppCopyController – This is the controller extension that will be modified for your object type and filtering requirements.

oppCopyControllerTest – This is the test class for the controller extension. It wasn’t built out because each environment will have unique data creation requirements. However, the basic concept of creating the data, instantiating the controller, and testing the list method will be common.

oppCopy – This is the Visualforce page that contains the list, jQuery logic, and Super Clone Pro copy component. The page loads the list of related records, and then the standard Lookup section is hidden. The list is monitored for a selection, and then the values for the lookup are set using Javascript.

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.