Super Clone Pro
Clone Page and Custom Button Settings
Clone functionality will make a copy of the primary object and the child relationship records from an 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 allows field values to be set, copied, or left empty. The “Allow Cloning Multiple Times” will present the user with a input field where a number can be entered for how many copies should be created. The Clone page can be skipped by checking the “Skip Clone Confirmation Page” check box on the configuration, so the user will directed immediately to the new object’s page.
URL Parameter Options
- cfg – The name given to the configuration.
- rid – A record Id of the object being cloned.
- saveURL2 – This is a URL encoded string that references a custom page to navigate to after the clone operation completes.
- This will override the “After Clone Display” setting of the configuration.
- Use this URL parameter to navigate to a page that is not an option in “After Clone Display” setting, like a custom Visualforce page.
- The URL parameter ‘saveURL’ can also be used. However, the platform sometimes corrupts the URL.
- retURL2 – This is a URL encoded string that references a custom page to navigate to after the cancel button is pressed.
- clonemult – Preset the number of clones that are requested when using the clone multiplier feature.
- 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.
- 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.
- [newid] – This is a special constant that is replaced with the first cloned record 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.
Clone Page Example
- rid – The opportunity and selected child relationships from this record will be cloned.
- cfg – OpportunityClone is the name of the configuration.
[newid] and saveURL2 Examples
Use the URL parameter “saveURL2” to redirect to a custom page after the clone 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 newly cloned record Id.
- The custom button URL above will redirect you to the Opportunity tab after the clone completes successfully.
- The custom button URL above will redirect you to the standard Opportunity edit page after the clone completes successfully.
- A constant of ‘[newid]’ is replaced with the new record’s Id in the ‘saveURL2’ parameter. This allows you to redirect to a new page passing the new record’s Id.
- This string ‘%2F%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
Page Layouts in Lightning
- 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.