0

I have custom object with Lookup to contact and need few fields in custom object which are already present in Contact.

Is it good to create formula field in custom object or create a same field and populate the data using trigger?

1 Answer 1

2

Formula, you never want to set yourself up to manage more code, alway less.

There are a few reasons for code over formula (being close to limits, needing to fire Workflow Rules when the value on the field changes, etc) but if you don't fall into those categories, go with formulas.

Corollary: Never write code if you can avoid it.

3
  • 1
    Kinda depends on how many of them you have. If you apply this strategy to 25 fields, eventually you run out of cross-object formulas when you actually need them.
    – Adrian Larson
    Jun 20, 2016 at 17:23
  • 1
    Adrian, I explicitly called out being close to the limits. Jun 20, 2016 at 17:24
  • 2
    Hmm, perhaps we define explicitly differently. I glossed over it the first time, and you never do mention what the limit is.
    – Adrian Larson
    Jun 20, 2016 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .