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
pooja chauchanpooja chauchan 

Open newly created record in edit mode

I have a trigger which creates a new record in the same object based on some criteria. I'm using standard object tab. The requirement is, as soon as user click on save for existing record, and a new record is created by trigger, user should be redirected to the new record in edit mode
Best Answer chosen by pooja chauchan
bob_buzzardbob_buzzard
You can't do this with standard functionality I'm afraid - the trigger is disconnected from the front end session and invoked out of the database.  Therefore there is no way for it to return information to the front end.  Although even if it could, you can't change the behaviour of the standard front end.  The only supported option for this is to Visualforce the create page and redirect the user to the new object edit page after the save completes.

All Answers

bob_buzzardbob_buzzard
You can't do this with standard functionality I'm afraid - the trigger is disconnected from the front end session and invoked out of the database.  Therefore there is no way for it to return information to the front end.  Although even if it could, you can't change the behaviour of the standard front end.  The only supported option for this is to Visualforce the create page and redirect the user to the new object edit page after the save completes.
This was selected as the best answer
Gaurav NirwalGaurav Nirwal

No you can not navigate from the trigger.

But this could be possible if you are on a VFP when the criteria for new record is satisfied. In this case you could query the database to get new records id and navigateto it.