function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Craig CoulterCraig Coulter 

formula field limits

Hi All,

We have a number formula field which holds a Case function and the current compiled size is 9,788 characters and to add anyting else to it, we have to delete existing values. We need to continue to add to this, so what is the best way to do that?

Thanks

Craig
SwethaSwetha (Salesforce Developers) 
HI Craig,

From https://help.salesforce.com/s/articleView?id=sf.formula_field_limits.htm&type=5 m I see "Formula fields can’t exceed 15,000 bytes when compiled. "

If you need to add more logic to a formula field that has already reached its limits, you can consider using workarounds such as splitting the formula into multiple fields or using Apex code instead of a formula field

I'd suggest following the approaches listed in https://www.simplysfdc.com/2013/11/salesforce-formula-size.html?m=1

https://help.salesforce.com/s/articleView?id=000385147&type=1

Related: http://resources.docs.salesforce.com/244/9/en-us/sfdc/pdf/salesforce_formula_size_tipsheet.pdf

If this information helps, please mark the answer as best. Thank you
aanojas lanceraanojas lancer
If feasible, divide the existing formula into smaller formula fields. Each field can handle a subset of the computations or logic, and the ultimate result can be obtained by referencing and combining the values from the smaller formula fields. 
If the complexity of your calculations exceeds the capabilities of formula fields and workflow rules, you can consider implementing an Apex trigger. Triggers provide greater flexibility and can handle more complex logic and calculations. They can update fields, perform calculations, and store the results in separate fields, avoiding the formula field size limit.
visit:- Salesforce formula size (https://www.simplysfdc.com/2013/11/salesforce-formula-size.html?m=1)
If my response is of use to you, please mark the response as best if this information is relevant. Thank you very much.