You need to sign in to do that
Don't have an account?

Custom Clone functionality redirecting to standard Edit page: Cancel button overwrite?
Hi All,
DId not find a similar question in the past so here it goes:
We have created a custom clone functionality. What this does is clone the record, empty some fields, update the parents, and then inserts the record in the database. Afterwards the page is redirected to the edit page of the record.
However, the standard Salesforce Edit detail record page has a cancel button. This cancel button just directs to the ?retURL paramters. So it will go back the to detail view.
Because we performed the clone and we needed to insert this cloned record into the DB before redirecting to the Edit page, the record will not be 'cancelled' in the way of cancellation the entire clone. So the record must be deleted again.
Is there a way to capture the Cancel event? Or to redirect the page to the edit detail view of the record without inserting it into the DB? So then the user can still Click on Save and we have the requisted functionality.
Thanks,
Robin
DId not find a similar question in the past so here it goes:
We have created a custom clone functionality. What this does is clone the record, empty some fields, update the parents, and then inserts the record in the database. Afterwards the page is redirected to the edit page of the record.
However, the standard Salesforce Edit detail record page has a cancel button. This cancel button just directs to the ?retURL paramters. So it will go back the to detail view.
Because we performed the clone and we needed to insert this cloned record into the DB before redirecting to the Edit page, the record will not be 'cancelled' in the way of cancellation the entire clone. So the record must be deleted again.
Is there a way to capture the Cancel event? Or to redirect the page to the edit detail view of the record without inserting it into the DB? So then the user can still Click on Save and we have the requisted functionality.
Thanks,
Robin
What do you mean with cancelURL parameter?
cancelurlString = '/apex/vfclone?action=recorddel&delrecid='+clonedrecid;
Then in the edit page vavigation url append this cancel url also like below:
redirecturl = redirecturl+'&cancelURL='+cancelurlString;
So when the cancel button is clicked from edit page ypu will be redirected to the VF page and check for the action and based on that you can delete.
So your Clone button will look something like: <a href="apex/myClonedRecordEditPage?id={!recordToClone.Id}">
Your myClonedRecordEditPageController:
and your myClonedRecordEditPage vf page something like:
http://raydehler.com/cloud/clod/salesforce-url-hacking-basics-with-returl-saveurl-and-cancelurl.html
Meera, thanks for your replace! I'm going to give this approach a go. Will let you know if this has worked or not!
Thanks,
Robin
I am facing the same issue, were you able to find the solution? if so, would you mind sharing it?
Thanks
Even I am also facing exactly same issue. On click of cancel its going to parent record which is fine but record is getting cloned. Please help if u have got the solution for this.