Super Clone Pro
Embed Components into Lightning Communities

Super Clone Pro can be used in Lightning Community themes, like the Napili template. Use a Visualforce custom button to display the Clone, Copy, or Edit page instead of a URL custom button. A URL custom button has difficulty with navigation in the community templates. To create the Visualforce custom button, we will first create a Visualforce page that references the standard controller of the primary object. Then we will reference this page in the custom button, and add the button to the page layout.

Simple Visualforce Page – Clone, Copy, or Edit

The Super Clone Pro Visualforce components put into the Visualforce page. Component reflect the common URL parameters that can be used on their respective pages. See the table below for each pages component parameters.

 /* Clone Page */
<apex:page standardController="My_Object__c"  showHeader="{!$User.UIThemeDisplayed == 'Theme3'}" >
    <lcrm_scp:ScpClone RecordId="{!My_Object__c.Id}" 
                ConfigurationName="MyObjectConfig"  />
</apex:page>

/* Copy Page */
<apex:page standardController="My_Object__c"  showHeader="{!$User.UIThemeDisplayed == 'Theme3'}" >
    <lcrm_scp:ScpCopy RecordId="{!My_Object__c.Id}" 
                ConfigurationName="MyObjectConfig"  />
</apex:page>

/* Edit Page */
<apex:page standardController="My_Object__c"  showHeader="{!$User.UIThemeDisplayed == 'Theme3'}" >
    <lcrm_scp:ScpEdit RecordId="{!My_Object__c.Id}" 
                ConfigurationName="MyObjectConfig"  />
</apex:page>

Advanced Visualforce Page – Clone, Copy, or Edit

Setting some component parameters may require additional logic from a controller extension. Parameters that will be passed in the “UrlParameterKeyList” and “UrlParameterValueList” will require the creation of an extension. The two corresponding lists are converted into a name/value pair map. A map collection wasn’t used as the parameter because of challenges they have as component parameters.

Below is a Cloning example of a Visualforce page with controller extension that includes advanced parameters. The example “uparam” would be a custom parameter that would be reference by a field with an “Action” of “Set by URL Parameter” in the configuration. The “rowsperpage” will control pagination of the child relationships, and “norerender” will refresh the page on submission to prevent an error message if a rich text field is used.

<apex:page standardController="My_Object__c" extensions="MyObjectExtController" showHeader="{!$User.UIThemeDisplayed == 'Theme3'}" >
    <lcrm_scp:ScpClone RecordId="{!My_Object__c.Id}" 
                ConfigurationName="MyObjectConfig" 
                PrimaryColumns="1" 
                UrlParameterKeyList="{!keyList}"  
                UrlParameterValueList="{!valueList}"  />
                
</apex:page>
public class MyObjectExtController {
    public MyObjectExtController(ApexPages.StandardController controller) {}

    // keys to mimic the URL parameter map
    public List<String> getKeyList() {
        return new List<String>{'uparam','rowsperpage','norerender'};
    }
    
    // values to mimic the URL parameter map
    public List<String> getValueList() {
        return new List<String>{'New Value','10','1'};
    }
}

 

Clone Component Parameters

Name Type Description
ConfigurationName String Name of the configuration.
PrimaryColumns String The number of table columns the Primary object will display.
RecordId String Record Id to clone.
retURL String URL to redirect to after Canceling.
saveURL String URL to redirect to after Saving.
UrlParameterKeyList String List List for URL parameter keys. Corresponding URL Parameter Value list is required.
UrlParameterValueList String List List for URL parameter values. Corresponding URL Parameter Key list is required.

Copy Component Parameters

Name Type Description
ConfigurationName String Name of the configuration.
FromId String Record Id to to copy child records from.
PrimaryColumns String The number of table columns the Primary object will display.
RecordId String Record Id to copy to when a From Id exists, or record Id to copy from when From Id is empty.
RelationshipName String Lookup relationship to be used when prompting user to select a record to copy to.
retURL String URL to redirect to after Canceling.
saveURL String URL to redirect to after Saving.
UrlParameterKeyList String List List for URL parameter keys. Corresponding URL Parameter Value list is required.
UrlParameterValueList String List List for URL parameter values. Corresponding URL Parameter Key list is required.

Edit Component Parameters

Name Type Description
ConfigurationName String Name of the configuration.
PrimaryColumns String The number of table columns the Primary object will display.
RecordId String Record Id to clone.
retURL String URL to redirect to after Canceling.
saveURL String URL to redirect to after Saving.
UrlParameterKeyList String List List for URL parameter keys. Corresponding URL Parameter Value list is required.
UrlParameterValueList String List List for URL parameter values. Corresponding URL Parameter Key list is required.