Forum Post: How can I initialize a field when a record is created/updated?

  • Thread starter Thread starter Pieter van Ginkel
  • Start date Start date
Status
Not open for further replies.
P

Pieter van Ginkel

Guest
I have a field which contents depends on some other fields and which can be calculated. The design is a bit like forum threads. You have a forum and the forum has messages. The message has a link to the forum. When a new message is created, the forum is automatically set on create, from the forum that was selected. When I now want to create a reply message, the parent message gets set from the context where I created the reply. However, the forum field is not automatically set. I've fixed this with trigger which looks at the parent message and copies the forum ID. I have two challenges with this design. First, if I make the forum field mandatory, the validation doesn't allow me to save the record because the trigger is executed too late. Second, I really do not want the forum field to be visible at all in the new/edit, and would like to have it set automatically from either the forum I created the message from, or the trigger that copied the forum from the parent message.

Continue reading...
 
Status
Not open for further replies.
Back
Top