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
Justin.WilliamsJustin.Williams 

How do I direct which new record the user will see after the conversion?

All my lead conversion triggers to date leave the user on the screen that shows what records have been created from the conversion.  In most cases this is not really a problem.  My newest trigger I have a different need.

 

In my conversion I convert the lead into an acocunt and contact but no Oppty.  I also create a new case with the new account and contact as being related to the case.  The trigger is 'after insert' so as soon as they hit save the first time I want the trigger to run and have the user looking at the new case created by the trigger.  I get everything to work except the last part to re-direct the user to the new Case record.  How can I do that?  Can they be directed to the Case in edit mode?  Thanks all.

sfdcfoxsfdcfox
Not with a trigger. You'll need some Visualforce code to do that. Triggers only deal with database logic and not with controlling the UI (user interface); directing a user to a specific page is a user interface feature, so you need Visualforce for this.