Error: Compiled formula is too big to execute (5,254 characters). Maximum size is 5,000 characters Description Help Text

formulaformula-fieldnumberupdate

I Have 20 formula fields that calculate a number value based on picklist value selected multiplied by a value in custom metadata. I want to sum all these 20 fields based on changes of the picklist values.

I get the error:
Error: Compiled formula is too big to execute (5,254 characters). Maximum size is 5,000

I dont see how to make my formula fields more simple to gain 254 characters.

I tried to use te solution workflow rule with workflow formula but then get the error: that the custom metadata field does not exist.

Example formula 1 field:

Picklist ABC_Call_5_min__c

VALUE(TEXT(ABC_Call_5_min__c)) * $CustomMetadata.ABC_Guide__mdt.ABC_Basic.ABC_Call5min__c

How do I resolve this.

Thanks in advance

Best Answer

Using a formula in another formula increases the dependent formula by at least the compile size of the formula that's included. This means that formulas get real expensive real quick when you start including them in other formulas.

The "Workflow Field Update" solution is close; you'll want to use a Record-Triggered Flow to calculate the correct values to place into new fields that will replace your formulas, and then you can easily add those values together in the final summary formula field.

Related Topic