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
AussieBattlerAussieBattler 

Redirect after updating records

Hi. This is probably very simple. I have created a trigger which updates some records upon a user clicking on the SAVE button, after the updates I then want to redirect them to a custom object (which depends on what they have selected before clicking on save). In other words, I don't want them to view the saved record but immediately be directed to a new create screen for another object.

I have everything working fine but I cannot work out how to direct them to the create page for a custom object? I would assume it is possible to do from within the trigger but I can't find out how. Any assistance appreciated.
Best Answer chosen by Admin (Salesforce Developers) 
AkiTAkiT
I have seen this happening in some Appexchange application - after trigger the page redirects - some sort of combo of trigger and s-control.

Not sure how it's really done.

Anyone knows?

All Answers

mtbclimbermtbclimber
This is not possible to do. You can't change the standard navigation of the app with Triggers. They are behind the scenes and only materialize in the UI through error messages.
AussieBattlerAussieBattler
Oh. Do you have any suggestions on how I can achieve this? Essentially I need to redirect a user to a create screen for a particular custom object (one of three) once they click the save button. The object thet are directed to depends on the value a user selects from a picklist.

Many thanks for any assistance provided.
mtbclimbermtbclimber
This is something that could be built with visualforce..... when it is available. ;-)

In the mean time your options are to either build this interface in an scontrol (client-side technology, i.e. javascript) or bring up a server to host an interface (server-side, i.e. asp, jsp, php, etc.).
AussieBattlerAussieBattler
Ah. Visualforce. I am attending a webinar on that next week. I appreciate I am probably pushing my luck but would you have any example code of how I could achieve this in an s-control? I am trying to avoid building separate interfaces at this stage, but I can see that may be necessary soon. Thank you for your assistance by the way.

Cheers.
Captain SFCaptain SF
Hi, Is there any way to redirect user after SAVE action to create object page without "Visualforce"?

Thank You,

AkiTAkiT
I have seen this happening in some Appexchange application - after trigger the page redirects - some sort of combo of trigger and s-control.

Not sure how it's really done.

Anyone knows?
This was selected as the best answer