function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

redirect to Visualforce page on record save

I would like to redirect to a Visualforce page I've created when a user saves an Opportunity, and the Opportunity is closed/won. I've written a trigger to test the logic and the new VIsualforce page, but I'm stumped on how to accomplish the redirect because apparently according to this thread: you can't redirect from a trigger.

Does anyone have any ideas on how to accomplish this?

Thanks in advance...
Best Answer chosen by Admin (Salesforce Developers) 
u can do it by using S-contrl override the Save button......

All Answers

u can do it by using S-contrl override the Save button......
This was selected as the best answer
The manual says APEX can not do this.

What are the Limitations of Apex?

Apex radically changes the way that developers create on-demand business applications, but it is not currently meant to be a

general purpose programming language. As of this release, Apex cannot be used to:

Render elements in the user interface other than error messages

Change standard functionalityApex can only prevent the functionality from happening, or add additional functionality

Create temporary files

Spawn threads


You can do this with an s-control in the interim, until apex or VF alternatives are available.


create a html s-control something like this


var newURL= "{!URLFOR ( $Action.Contact.NewContact, null, [ saveURL=
$Action.Contact.View ], true) }"; 


Then override your standard button. Done. 

how can we override a standard save button?


mallikam wrote:
how can we override a standard save button?

use on Update / on Insert in a trigger and it will accomplish what you want.