Skip to main content
I want to populate a parent field value in a chaild field for displaying in a standard visual force page. So, I thought I will create a formula field for the same, but one of my collegue said don't create formula field, create a text field and assign the text field value while creating the child record in trigger.

So, I just want to know, which approach is better and why?

NOTE: The parent child relationship is lookup relationship.
2 answers
  1. Jan 12, 2017, 9:15 AM
    Hi Upendra,

    Formula field values are NOT stored in the database and are calculated after each time records are being read from database. If you can imagine, this can make things slow down. You see, even if values where not changed, formula calculation has still to be processed.

    As your friend suggested, it is better to write/update the value during trigger. Thus saving you a process time.

    Hope this can help.
0/9000