Save Button Override: Redirect to Parent Record after clicking SAVE on the Child Record: Salesforce

5:31 PM

Problem description:

Let's take the scenario of Account - Contact. On the Account Detail page you have the Contact related list. When a user clicks on the 'New' button in the 'Contact' related list, a Contact Edit Screen shows up. When the user clicks 'Save' he is redirected to the 'Contact Detail Page'.

You want to redirect the user to the parent 'Account Detail Page' instead.


Create a Custom button on Contacts as shown below.


Analyzing the 'Button or Link URL':


003 - Denotes Contact (The child record, will be different for each object. Click on the standard NEW button of any object and you could find out the unique code for that object)

retURL=%2F{!Account.Id} - the URL you want to redirect the user to when he clicks CANCEL. %2F denotes a '/' and the merge field {!Account.Id} gives the Account to redirect to.

saveURL - similar to retURL except that it defines the URL to redirect to after the user clicks 'SAVE'


Add the 'New' custom button to the Account Page Layout.



  1. Nice vijay... but the newly created contact is not associated to that particular account while creating we need to manually choose the account by this..while default functionality directly associates the contact to the account..if we do that it is more helpful

    1. Have a look at

  2. What if i want to a reverse scenario, if there was a child record and had to access it from a button on the Standard page.

  3. Nashor, were you able to crack it ? I have a similar requirement..