Super Clone Pro
Copy Page and Custom Button Settings
Copy functionality will copy child relationship records from an object. Child relationship records can be copied to a new parent of the same type, back to same parent record, or to a new parent of a different type that has a relationship with the child object. Unlike the clone functionality, the copy does not create a new primary object. To get started, all you need to do is create a configuration, create a custom button, and add the custom button to a page layout.
The configuration for the copy page is similar to that of the clone page where field values can be set, copied, or left empty. However, the copy page does not allow fields on the primary object to be edited.
Behavior of the copy page changes depending on the URL parameters. When the URL only contains parameters for record id and configuration name, a lookup is presented that allows the user to select an object that the records will be copied to. When the “fromid” URL parameter is used, related list records from the referenced object are shown and copied to the record that is referenced in the “rid” URL parameter.
Example 1: Copy from One Object to Another Object – Detail Page Button
Example 2: Copy from Another Object to the Current Object – Detail Page Button
Example 3: Copy Related List Records to the Same Parent – Related List Button
Example 4: Copy Related List Records to a Different Object Type – Detail Page Button
Example: [newid] and saveURL2 Examples
URL Parameter Options
- cfg – The name given to the configuration.
- rid – A record Id.
- If the “fromid” URL parameter is not used, child records on this record will be copied to a record that the user selects.
- If the “fromid” URL parameter is used, child records on the “fromid” record will be copied to this record.
Optional Parameters:
- lss – Add ‘lss=1’ to the URL. This will tell the page to apply Lightning style sheets when the page is viewed in Lightning Experience.
- fromid – A record Id. If present, child records from this record will be copied to the record referenced in the “rid” parameter.
- Set ‘fromid=prompt’ for the user to be prompted to choose a record to copy related lists from.
- relname – A child relationship name used to select a lookup field. The field for this relationship on the child relationship will be used to prompt the user to select a record to copy to.
- This only valid when “fromid” is not specified.
- It is only needed to make the lookup field more intuitive when the default field that prompts the user to select a copy to record doesn’t have a helpful label or is valid for multiple objects (like ParentId on Task).
- lss – Add ‘lss=1’ to the URL. This will tell the page to apply Lightning style sheets when the page is viewed in Lightning Experience.
- saveURL2 – This is a URL encoded string that references a custom page to navigate to after the copy operation completes.
- By default, the parent record will be displayed after the operation that the child records were copied to.
- Use this URL parameter to navigate to a new page that isn’t the default, like a custom visualforce page.
- retURL2 – This is a URL encoded string that references a custom page to navigate to after the cancel button is pressed.
- activeteam – Add ‘activeteam=1’ to the URL. This will add filtering to the AccountTeamMember, OpportunityTeamMember, and CaseTeamMember objects, so only active users are included when cloning. This prevents the ‘Owner or User is Inactive’ exception.
- debugrollback – Add ‘debugrollback=1’ to the URL. This will cause the processing to run the insert commands to see if the transaction will run successfully, and then it will rollback the transaction to prevent the records from committing to the database.
- displayrid – Add ‘displayrid=1’ to the URL, and this will cause the page to display data from the record referenced by the ‘rid’ parameter at the top of the page instead of data from the record that is being copied from.
- norerender – Add ‘norerender=1’ to the URL, and this will cause the page to refresh entirely instead of rerendering the portion of the page that displays the data. Use this when displaying a Rich Text field to avoid the ‘Rerender is not currently supported with rich text editing enabled’ message.
- pricolumns – Specify a number of columns to display for the primary object. Valid values include 1 to 8 columns.
- rowsperpage – A number of rows that will display for a record level.
- rowsperpagel2 – A number of rows that will display for record level 2. This overrides the rowsperpage for this level.
- rowsperpagel3 – A number of rows that will display for record level 3. This overrides the rowsperpage for this level.
- rowsperpagel4 – A number of rows that will display for record level 4. This overrides the rowsperpage for this level.
- buttonSave – Set custom button text by assigning a value to this parameter (&buttonSave=ButtonText), or hide the button by setting it equal to 0(&buttonSave=0).
- buttonCancel – Set custom button text by assigning a value to this parameter (&buttonCancel=ButtonText), or hide the button by setting it equal to 0(&buttonCancel=0).
- [newid] – This is a special constant that is replaced with the copy to record’s Id in the ‘saveURL2’ parameter string.
- This allows you to redirect to a different page passing the new record’s Id as a URL parameter.
Copy Page Examples
Example 1: Copy from One Object to Another Object – Detail Page Button
The user will be prompted to select a record. By default, the prompt will ask the user to select a record to copy child relationships to. If the user should select a record where child relationships will be copied from, use the ‘fromid=prompt’ as a URL parameter.
Default: User selects record to copy child relationships to
/apex/lcrm_scp__scpCopy?rid={!Opportunity.Id}&cfg=OpportunityProductCopy&lss=1
User selects record to copy child relationships from
/apex/lcrm_scp__scpCopy?rid={!Opportunity.Id}&cfg=OpportunityProductCopy&lss=1&fromid=prompt</code
- rid – The child relationships from this record will be copied to a new opportunity selected by the user.
- cfg – OpportunityProductCopy is the name of the configuration.
- lss– This is the switch that will apply Lightning Style Sheets when the page is viewed in Lightning Experience.
Example 2: Copy from Another Object to the Current Object – Detail Page Button
The “fromid” URL parameter is specified, so the user will not be prompted to select a record. The child records of the “fromid” record will be copied to the record specified in the “rid” URL parameter.
/apex/lcrm_scp__scpCopy?rid={!Opportunity.Id}&cfg=OpportunityProductCopy&lss=1&fromid=006o0000003XS1x
- rid – Child records will be added to this record
- cfg – OpportunityProductCopy is the configuration name
- fromid – The child records on the opportunity with id of 006o0000003XS1x will be copied to the record specified in the rid URL parameter. The value for “fromid” could be a hard coded value like in the example or a field variable like the value assigned to “rid”.
Example 3: Copy Related List Records to the Same Parent – Related List Button
This example is similar to the previous example, but there are two differences. First, the URL parameter “fromid” is set to the same value as the “rid” URL parameter. Second, the custom button is defined on the child object as a “List Button”, so it can show on the page layout’s related list.
Place the custom button on the Opportunity page. Below is a simple example of what the screen would look like after clicking saving the Quote.
/apex/lcrm_scp__scpCopy?rid={!Account.Id}&cfg=contactcopy&lss=1&fromid={!Account.Id}
- rid – Child records will be added to this record
- cfg – contactcopy is the configuration name
- fromid – The child records on the Account will be copied back to itself because both “rid” and “fromid” are the same value.
Example 4: Copy Related List Records to a Different Object Type – Detail Page Button
This example will show configuration and custom button settings that will copy custom Item records from an Opportunity to a Quote. The custom Item object in this scenario will have lookup relationships to both Opportunity and Quote. This will also be incorporated into the native quote creation page, so the Super Clone Pro page to copy the records will appear after saving the Quote.
First, create a clone configuration on the Opportunity because this is where the custom Item records will be copied from. In the Field Value Configuration section, set the action for lookup field to the Quote object as “Action Formula List“. Set the value column to “RELATIONSHIPID(clear)“.
For more information on “RELATIONSHIPID()” options see the Configuration Setup page.
/0Q0/e?retURL=%2F{!Opportunity.Id}&oppid={!Opportunity.Id}&saveURL=%2Fapex%2Flcrm_scp__scpCopy%3Fcfg%3DOpportunityItemCopy%26retURL2%3Dnewid%26rid%3Dnewid%26fromid%3D{!Opportunity.Id}
The custom button first loads the native Quote creation page, and it assigns the “oppid” URL parameter the Opportunity’s record id. The “saveURL” parameter is URL encoded text, and it will redirect to the Super Clone Pro Copy page. The value “%2Fapex%2Flcrm_scp__scpCopy%3Fcfg%3DOpportunityItemCopy%26retURL2%3Dnewid%26rid%3Dnewid%26fromid%3D” when decoded is “/apex/lcrm_scp__scpCopy?cfg=OpportunityItemCopy&lss=1&retURL2=newid&rid=newid&fromid=”. Here is a break down of the encoded parameters.
- The”cfg” URL parameter selects the “OpportunityItemCopy” configuration.
- The “fromid” URL parameter is assigned the Opportunity record id.
- Salesforce appends the URL parameter “newid” when redirecting from the native record creation screen, and “rid=newid” will assign the new Quote’s record id to the Super Clone Pro “rid” parameter.
- “retURL2=newid” tells the page to redirect to the new quote if the Cancel button is clicked.
After clicking “Copy”, the user will be directed to the Quote page, and they will see the copied custom Item records attached to the Quote.
Example: [newid] and saveURL2 Examples
Use the URLparameter “saveURL2” to redirect a custom page after the copy operation. The value of this parameter is a URL encoded string. “[newid]” can be included in the value, and it will be replaced with the record Id of the record that had child records copied to it.
/apex/lcrm_scp__scpCopy?rid={!Opportunity.Id}&cfg=MyConfig&lss=1&saveURL2=006
- The custom button URL above will redirect you to the Opportunity tab after the copy completes successfully.
/apex/lcrm_scp__scpCopy?rid={!Opportunity.Id}&cfg=MyConfig&lss=1&saveURL2=%5Bnewid%5D%2Fe%3FretURL%3D%2F%5Bnewid%5D
- The custom button URL above will redirect you to the standard Opportunity edit page after the copy completes successfully.
- A constant of ‘[newid]’ is replaced with the new record’s Id in the ‘saveURL’ parameter. This allows you to redirect to a new page passing the new record’s Id.
- This string ‘%5Bnewid%5D%2Fe%3FretURL%3D%2F%5Bnewid%5D’ is the URL encoded value for this ‘[newid]/e?retURL=/[newid]’, which is what shows in the location bar when editing a record.
Page Layouts in Classic
Find the page layout for the object, and drag the Super Clone Pro custom button from the collection of buttons onto the Custom Button section of the page.

Page Layouts in Lightning
Salesforce has separated the configuration for custom buttons that show in Classic from Lightning. This allows different buttons to be shown when users are in different interfaces.
- If the “Salesforce Mobile and Lightning Experience Actions” are not overridden, then adding a custom button is the same as shown above with the Classic interface.
- If the page layout is configured to show differently in Classic and Lightning, then the Super Clone Pro custom button will need to be added from the “Mobile & Lightning Actions” collection of buttons. Drag the button into the “Salesforce Mobile and Lightning Experience Actions” section of the page.
