override button
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.
STEP 1:
Create a Custom button on Contacts as shown below.
STEP 2:
Analyzing the 'Button or Link URL':
/003/e?retURL=%2F{!Account.Id}&saveURL=%2F{!Account.Id}
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'
STEP 3:
Add the 'New' custom button to the Account Page Layout.
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.
STEP 1:
Create a Custom button on Contacts as shown below.
STEP 2:
Analyzing the 'Button or Link URL':
/003/e?retURL=%2F{!Account.Id}&saveURL=%2F{!Account.Id}
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'
STEP 3:
Add the 'New' custom button to the Account Page Layout.