Submit a Queueable to Clone Records
September 1, 2020
How To: Redirect to the Lightning Edit Modal After Saving
April 22, 2021

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

public class ScpEditRedirectController {
    public PageReference redirect() {
        return new PageReference('/apex/lcrm-scp__scpedit?lss=1' +
                    '&rid=' + ApexPages.currentpage().getparameters().get('rid') +
                    '&cfg=' + ApexPages.currentpage().getparameters().get('cfg') +
                    '&saveURL2=' + EncodingUtil.urlEncode(URL.getSalesforceBaseUrl().toExternalForm() + '/apex/ScpEditRedirect?' +
                                   '&rid=' + ApexPages.currentpage().getparameters().get('rid') +
                                   '&cfg=' + ApexPages.currentpage().getparameters().get('cfg')
                                   , 'UTF-8'));

Visualforce Page: ScpEditRedirect


Custom Button

{!URLFOR("/apex/ScpEditRedirect", null, [rid=Account.Id, cfg="MyConfig"])}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.