Formula Field exceeds maximum number of characters
|Knowledge Article Number||000005456|
The code in a Formula Field can exceed the maximum number of characters allowed. Learn the two ways this can happen, below.
1. The code in a Formula Field can exceed the maximum number of characters allowed in two ways:
2. The latter of those problems can result from the formula (code) of other formulas being inserted where those other formula fields are included. For example:
What to do if you run into either limit
1. The smaller character limit (3900) can be remedied by splitting the formula into 2 fields. Create another formula field and break out some part of the code into that one. Then call Formula_A within Formula_B. Each can have up to 3900 characters.
2. The trickier case is when a formula field that refers to other formula fields (that may in turn refer to even more formula fields) results in compounded code which exceeds the 5000 bytes limit. In any edition, the whole combination of formula can be scrutinized to see if there is anything that can be reduced or eliminated from the string of code. Any small part might have a ripple effect and significantly reduce the overall size.
3. In Enterprise (EE) or Unlimited Edition (UE) Workflow can be used to help out.
1. Create a new hidden field (not visible on any Page Layout).
4. Apex code could also be used in (EE, UE) to trigger an update to a field on the record. This provides even more powerful and flexible options, including the capability to assign values based on procedural algorithms (e.g., a double-declining balance) and to reference values beyond the record/object that is being evaluated in a formula or workflow, similar to the VLOOKUP() function--that can be employed on a validation rule but not in a custom formula field.