Skip to main content

I have a formula. 

 

When I click "Check Syntax" Salesforce tells me "No syntax errors in merge fields or functions. (Compiled size: 2,325 characters)"

 

But when I click "Save" Salesforce tells me "Compiled formula is too big to execute (6,496 characters). Maximum size is 5,000 characters (Related field: Formula)"

 

Here's a screenshot showing the two different character counts on the same formula:

 

Compiled formula size calculated incorrectly... what to do?

 

I took a look at the constituent elements of the formula.

 

Vehicle_1_Coverage_Score = 295 characters

 

Vehicle_1_Value = 41 characters

 

Vehicles 2-6 use the exact same formulas / have the exact same character counts as Vehicle 1.

 

Formula calls Coverage score 1x and Value 2x for each of 6x vehicles.

 

So I'd expect my formula character count to be in the neighborhood of (295 + 2 * 41) * 6 =  2262

 

When you add in a few extra characters for other characters in the formula (e.g. "(", ")", "+", "/", etc.) you get the 2325 character count that the "check syntax" button produces.

 

I have no idea where the other 4100 or so characters are coming from in the 6496 character count. 

 

I think 2325 is the true character count and I'd like Salesforce to recognize this as the correct count and allow me to save.  Any ideas how to accomplish this?

 

Additional info: screenshots showing Vehicle_1_Coverage_Score = 295 characters and Vehicle_1_Value = 41 characters 

 

User-added image

 

User-added image
8 answers
  1. Mar 12, 2018, 7:39 PM

    Steve, thanks for the reply.

    I'm aware that the size of any one formula includes the size of all the other formulas it references.

    That's why I show the size of the formulas for Vehicle_1_Coverage_Score (295 characters) and Vehicle_1_Value (41 characters)  and include the size of these constituent formulas (the toppings) in the size of this formula (cost of pizza).  

    However, unless I'm missing something this answer does not explain why:

    (1) Salesforce calculates two different compiled sizes for this one formula or

     

    (2) why one of the formula's compiled sizes is significantly (nearly 3x) bigger than the sum of all of the fomulas used as inputs. 
0/9000