July 5, 2020

How To: Select Record when Copying to a Different Record Type

The copy page is typically used to copy related lists from one parent record to another record of the same object type. It also can copy related lists to another object type when the child object has lookup relationships to both from and to object types. The built in prompt field expect the same object type, so a little custom code is needed to prompt for the other object type. […]
September 1, 2020

Submit a Queueable to Clone Records

Below is an example that will submit a Queueable job to clone using Super Clone Pro. Visualforce <apex:page standardController="Account" extensions="accountCloneController" lightningStylesheets="true"> <h1> Clone: {!account.Name} </h1> <apex:form> <apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/> <apex:commandButton action="{!saveClone}" value="Save Clone and Return" immediate="true"/> </apex:form> </apex:page> Controller extension public class accountCloneController { Account sObj; public accountCloneController(ApexPages.StandardController con) { sObj = (Account) con.getRecord(); } public pageReference saveClone() { if (sObj != null && sObj.Id != null) { System.enqueueJob(new […]
November 12, 2020

How to: make the Super Clone Pro Edit Page redirect back to itself after save

Create a Visualforce page and Apex page controller to help the redirection logic. My example Visualforce page is named ScpEditRedirect, and the Apex controller is named ScpEditRedirectController. Finally, create a custom button that references this new custom page with the Super Clone Pro url parameters. Apex Controller: ScpEditRedirectController Visualforce Page: ScpEditRedirect <apex:page cache="false" controller="ScpEditRedirectController" action="{!redirect}"> <apex:form > <apex:commandButton action="{!redirect}" value="Load Edit Page" /> </apex:form> </apex:page> Custom Button
April 22, 2021

How To: Redirect to the Lightning Edit Modal After Saving

This is an example of the custom button url that would be used to redirect a user to the Lightning Edit Modal. We also need to include the backgroundContext URL parameter, so the record page is loaded underneath the window. Here is an example that references a Case object. The beginning of the URL is standard up to the saveURL2 parameter. /apex/lcrm-scp__scpClone?rid={!Case.Id}&cfg=MyConfig&lss=1&saveURL2=%2Flightning%2Fr%2FCase%2F%5Bnewid%5D%2Fedit%3FbackgroundContext%3D%252Flightning%252Fr%252FCase%252F%5Bnewid%5D%252Fview The saveURL2 parameter is an encoded URL that […]
October 14, 2021

How To: Load the Super Clone Pro Clone or Copy Page with Child Records Unchecked

The Clone and Copy page components can be embedded in a wrapper Visualforce page. This allows you to apply styles and use JavaScript to manipulate the page. This example shows how to uncheck all the child selection checkboxes on the page load. Finally, update the custom button to reference this new Visualforce page. Replace the name of the packaged page name “lcrm-scp__scpclone” or “lcrm-scp__scpcopy” with the new name. It should […]