Skip to main content
Upendra R (Own) 님이 #Apex에 질문했습니다
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개
  1. 2017년 1월 12일 오전 9:15
    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