+ Start a Discussion
Thennakon Witharanage AnushaThennakon Witharanage Anusha 

Formula field in salesforce

What are the disadvatages of a formula field and how can we overcome those disadvantages?
Hi Anusha,

There isn't any disadvantages, its just that:
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.

If you want to access latest value of formula in After Trigger, then instead of formula field, use a normal field and update it in trigger. 

But there are quite a few limitations of it:
  1. Fields are not allowed to be deleted if refer in Formula field. 
  2. Formula field cannot be a Long Text area
Hope this can help.

Skype: gaurav62990
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same query
1) https://developer.salesforce.com/forums/?id=9060G000000I23VQAS

Consideration: Force.com Formula Fields and Indexes

By default, Force.com formula fields don’t have indexes. So when you create and use a formula field on very large objects (say, objects that have more than one million records), the SOQL queries and reports using the formula field as a filter might perform slower because your queries and reports have to perform full scans to find target records.

Force.com SOQL Best Practices: Nulls and Formula Fields (https://developer.salesforce.com/blogs/engineering/2013/02/force-com-soql-best-practices-nulls-and-formula-fields.html)

Let us know if this will help you