well, pretty much as the title says.

I need the user to be redirected to a Custom VFP when a new record of a Custom Object is created, additional to this I need to be able to send the Id to that Custom VFP (I think I have the solution for this but want to confirm it).

What I have done so far

Tried using the override to the View button, but this led me to the Custom VFP without the Id and also whenever I want to view a different record, it takes me to the Custom VFP which I don't want to.

Tried to call a PageReference method in a trigger after inserted record, I think this way could be possible if I find the proper way to hack it.

My boss told that this was possible via trigger...

Please help :( and thanks.


No, your boss is incorrect; it's not possible via a trigger. Triggers have no context of a user interface, because they may be called from the API, Apex Code, etc. The only solution is to override the New Record page with a Visualforce Page, perform the save from the controller, and then redirect.

  • I thought about that, but as I'm still new in this, didn't want to go so deep, but guess what, I followed what you say and it works (almost perfect , just gotta do some adjustments).
    – AjFmO
    Nov 20 '18 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.