Imagine the user clicks a standard New button of a custom objects, populates some fields (in a Standard Layout) and then clicks save.
He then is redirected to the View page of this new record, but is many fields and related lists a populates with values and child records from a hidden template inside the app.
This all would be easy if the structure I am going to deserialize would be stand alone and not dependand on a parent record NOT part of the template.
I therefore required the user to manually populate a parent lookup field and the want to do this in the Before or Aftert Insert trigger:
- Get the lookup value from the user's record (temporary)
- Deserialize the serialized record (real) using the lookup value
- Delete the users record
Now my question: How can a trigger cancel inserting the original record and instead insert and redirect to another?