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

Can an apex trigger open a "New [object]" page?

Ok, so I have an object called "Project" and it has a child object called "Phase".  There's a field on Project called "Number of Phases".  A user creates a new project and let's say they put in 3 for the number of phases. I want it to automatically begin the creation of these phases, to automatically redirect the page to the "New Phase" page, and when they create that phase, to automatically go to phase 2, and so forth depending on how many phases they specified on the project.  Is this possible?
The triggers cannot do that.
The right way to do this is writing a custom Visualforce Page with a Form and apex controller, then when the user submit the data , check the condition and return the page to edit the new object if necessary.


One example in code?