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?

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.

  • 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 '16 at 17:23
  • 1
    Adrian, I explicitly called out being close to the limits. – Sebastian Kessel Jun 20 '16 at 17:24
  • 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 '16 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.