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
Austin_SteveAustin_Steve 

Error Invalid Data

I am trying to populate a formula field, and I'm getting the error:

"Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5,048). Maximum size is 5000 characters.

 

Fields involved in the erroneous formula: 

Fixed__c = Check Box field

Invoice_Discount__c = percent field

Quote_Discount_Amount__c = formula field 

                   IF( Quote_Price__c > 0, Quote_Price__c - ( Quote_Price__c *  Quote_Discount__c ), 0)

Actual_Project_Price__c = Roll up sum field

 

Formula generating the error:
IF (  Fixed__c = TRUE,
   IF ( Invoice_Discount__c > 0,  Quote_Discount_Amount__c  - ( Quote_Discount_Amount__c *  Invoice_Discount__c ), Quote_Discount_Amount__c),  
   IF ( Invoice_Discount__c > 0, Actual_Pjoject_Price__c - (Actual_Pjoject_Price__c * Invoice_Discount__c ), Actual_Pjoject_Price__c))

 

Obviously this formula is not 5000 characters. Check syntax button says it's 984 characters long.  Why am I getting the error that formula is too big?

 

Thanks in advance for any help

 

steve

 

Ispita_NavatarIspita_Navatar

Hi,

Your error says:-

"Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5,048). Maximum size is 5000 characters.

 

So it is the compiled size that is causing the problem not the actual size (the actual size is 984) - after compilation say each if statement generates 200 - compiled characters - so you probably have to eliminate some of the if clauses or try using "case" statement  and if possible may be you can transfer some of the calucation to another formula field in the object and then just reference those formula field in your final formula.

So it is compiled size whhich is a problem and not the actual size of your formula.

Did this answer your question? If not, let me know what didn't  work, or if so, please mark it solved.

Austin_SteveAustin_Steve

I will try switching the if's to a case statement.  I was wondering if there is a limit to the number of formula fields that can be used in other formula's?

 

Thanks

 

Steve

skodisanaskodisana

Hi,

 

You can use the Workflow Field Update for action to do this.

Field Update formula editor is having more character limit compared to Formula editor.

Please make the filed read only from FLS, So that users will not update manually. 

 

Thanks,

Kodisana