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.
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'));
}
}
<apex:page cache="false" controller="ScpEditRedirectController" action="{!redirect}">
<apex:form >
<apex:commandButton action="{!redirect}" value="Load Edit Page" />
</apex:form>
</apex:page>
{!URLFOR("/apex/ScpEditRedirect", null, [rid=Account.Id, cfg="MyConfig"])}