+ Start a Discussion
miha198206miha198206 

Change behavior of Save button

Hi

 

I have a custom object. When user will click New button to create new record of custom object and then click Save button I'd like to redirect him not to Details page but to other page. Is it possible?

Best Answer chosen by Admin (Salesforce Developers) 
jhenningjhenning
You can not override the standard Save button. You would need to create your own Visualforce page for the Edit and New function. Then on that custom page, your Save command button could redirect to a different page.

All Answers

imuinoimuino
I think you may need to override the button. For this you need to create your own controller to save the object and then do the redirect.
miha198206miha198206

Thank you for response. I understand how todevelop controllers but I don't know how to override standard Save button on standard salesforce page. Could you explain this more? 

jhenningjhenning
You can not override the standard Save button. You would need to create your own Visualforce page for the Edit and New function. Then on that custom page, your Save command button could redirect to a different page.
This was selected as the best answer
Suchitra PurushothamSuchitra Purushotham

Hi,

 

You cannot modify the save button, you can overrdide your New and Edit button, add a saveUrl parameter to your new button URL and pass the ID of the record or link where you want the browser to redirect after record creating.

 

Regards,

Suchitra

SanjivaniSanjivani

I have custom page having standard Save button. After saving, by default it goes to standard detail page, I want to redirect page to different URL, how to do that?