+ Start a Discussion
Siddhesh KabeSiddhesh Kabe 

Redirecting to a VF page after save. OnComplete not working.

Hey Hi, I am working on a Site and I need to use a standard Sav functionality, however I do not wish the page to move to the standard View page of the record.


 <apex:commandButton action="{!save}" value="Publish"  onComplete="window.parent.location.href='/apex/home';"/>              


I used onComplete but it is not redirecting to the page.


Please help


Warm Regards.



Best Answer chosen by Admin (Salesforce Developers) 
Richie DRichie D

Hi Siddhesh,


You may need to override the save method by having your own save method which calls the standardcontrollers save method.


You will need to return null from yours and it should work.