2

I have a simple formula that is referenced in other formula. When I tries to change a pickist field with another picklist field I can't save with the following message:

Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5.178 characters). Maximum size is 5.000 characters (Related field: Formula)

The formula is like this:

cod1__c & cod2__c &
IF(ISPICKVAL(Picklist1__c,"Value"),
  cod3__c&cod4__c,
  cod4__c&cod3__c
)

And I just want to change Picklist1__c to Picklist2__c.

I know that the problem is with a related formula, but i can't understand why just change one field with another field of the same type throws error.

Both picklists have the same options selected and have the same number of values.

Thanks!

1 Answer 1

2

If cod1__c, cod2__c, cod3__c, or cod4__c are also formulas, then their compiled size counts towards the compiled size of your formula. It could be that one of those are formulas, and were subsequently later edited to be longer than original, thus expanding the compiled size of this formula.

There's also a small variation in formula size if the picklist field's API name is longer than the original, and you were already near the maximum limit. For example, if the compiled size was 4999 before, and the new field name is two characters longer, that would put you at 5001.

If cod3__c or cod4__c is a formula, you'll get massive gains by not including them more than necessary (each time they're used, their entire compiled size counts towards the limit).

Try:

cod1__c & cod2__c &
IF(ISPICKVAL(Picklist1__c, "Value"), cod3__c, "") &
cod4__c &
IF(ISPICKVAL(Picklist1__c, "Value"), "", cod3__c)

This removes one copy of cod4__c, so if that's the culprit, it could drastically reduce the compiled size, despite needing to use Picklist1__c twice.

Also, if any of the fields are formulas, try optimizing those formulas to be more efficient, then try changing the field in your question again.

If that doesn't work, consider using a Workflow Field Update to set the value to a new, "editable" field that is marked as read-only to all users. This will eliminate the compiled size limit and allow you to have the data you're looking for.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .