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
Cthulhu4242Cthulhu4242 

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: http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=3321 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) 
~Onkar~Onkar
u can do it by using S-contrl override the Save button......

All Answers

~Onkar~Onkar
u can do it by using S-contrl override the Save button......
This was selected as the best answer
HarmpieHarmpie
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




Carl_V1Carl_V1

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

 

<html> 
<head> 
<title></title> 
<script> 
var newURL= "{!URLFOR ( $Action.Contact.NewContact, null, [ saveURL=
$Action.Contact.View ], true) }"; 
window.parent.location.replace(newURL); 
</script> 
</head> 
</html>

 

Then override your standard button. Done. 

mallikammallikam
how can we override a standard save button?
chris_parx2chris_parx2

 


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.