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
p_harroldp_harrold 

Compiled formula is too big to execute

I'm having trouble with the compiled size of a formula. I don't understand why this is compiling into so many characters. The formula simply adds 14 fields together, all of which are numbers. The custom number fields all have 18 digits, which I tried decreasing to 17 but it did not change the compile size. I've also tried changing the field label and field name of each of these 14 fields. I currently have it so it only adds up 13 of the 14 fields (which needs to change) because it can save that way.

 

Also, strangely enough, when I click "Check Syntax" it gives a compiled size of 529 characters.

 

Here is the full error when I try to save the formula:

Error: Invalid Data.
Review all error messages below to correct your data.
Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5,011 characters). Maximum size is 5,000 characters

 

Here is my formula:

Added_Value_Interactive_InStream_Video__c
+ Added_Value_App_Banner__c
+ Added_Value_FPA__c
+ Added_Value_In_Banner_Video__c
+ Added_Value_In_Stream_Video__c
+ Added_Value_Interactive_Pre_roll_SC__c
+ Added_Value_Mobile_Web_Banner__c
+ Added_Value_Tablet_Full_Page__c  
+ Added_Value_Tablet_Leaderboard__c  
+ Added_Value_Tablet_Medium_Rectangle__c  
+ Added_Value_Tablet_Square__c
+ Added_Value_Tablet_Wide_Skyscraper__c
+ Added_Value_In_Stream_Video_Blend__c
+ Added_Value_Video_Blend__c
+ Added_Value_Display_Blend__c

 

Hopefully someone has an idea of how to decrease the compile size by 11 characters...

 

UPDATE: I just tried copying and pasting this formula into a new field and it compiled and saved... I gave it the same characteristics as the previous formula (return type of number, 0 decimal places, 18 characters). Is it possible I can't save this custom field because it is being used by another custom field? If so, how will I know what other field is getting too big?

kcpluspluskcplusplus

What happens is you have another formula that references this formula about 10 times, giving that formula a compiled size of 5000+ characters. What I would recommend here if possible, is to shorten some of the API names of the fields, you're really not that far away from the compile limit so that should work for you. Be careful changing the names of fields as it can affect data in some instances. 

 

As far as seeing what formula is the one with the compile limit reached, there is no way to determine which one it is automatically. If you have multiple formulas that reference this field, one easy way to determine what formulas reference it is to attempt to delete the field being referenced. It won't let you, but it will list the ways that the field is referenced, and you can then look at them and logically determine which one is referencing the formula to the point it hits the compile limit.

 

A second option for you would be to include this field as a workflow field update, if you are on Enterprise or Unlimited. This can cause problems as the record needs to be saved to fire the formula, but workflow field updates A) do not have a compile limit and B) since they are doing a update, rather than containing a formula in the field, the compiled size that is referenced in the other formulas will be significantly smaller. 

 

--KC

bhorakiforcebhorakiforce
Slipt it into two formulas and combind it in final formula.