How To: Reference the original record in a new cloned record
March 4, 2017How To: Load the Super Clone Copy page after the native record creation page
Copying child relationships from an existing record that acts as a template can save users a lot of time. A custom button can show the native record creation page, and then prompt the user to copy child records from an existing record when the new record is saved. For example, this could be used when creating a new opportunity, and after the opportunity is saved a page displays child relationship records to add(copy) onto that new opportunity.
The native record creation page uses a URL parameter of ‘saveURL’ to redirect to a new page after record creation. This can be set with a URL encoded string that specifies the Super Clone or Super Clone Pro Copy page. In that URL encoded string, set the ‘rid’ URL parameter to equal ‘newid’. Salesforce appends the ‘newid’ URL parameter after the save operation.
Super Clone Example:
/006/e?retURL=%2F001%2Fo&saveURL=%2Fapex%2Fdh_superclone__superclonecopy%3Ffromid%3D{!Opportunity.Id}%26cfg%3DMyConfig%26rid%3Dnewid
Super Clone Pro Example:
/006/e?retURL=%2F001%2Fo&saveURL=%2Fapex%2Flcrm_scp__scpcopy%3Ffromid%3D{!Opportunity.Id}%26cfg%3DMyConfig%26rid%3Dnewid