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
prakash reddy 65prakash reddy 65 

nt allowing to save an formula field

As i was trying to save a field and it shows the following error:
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,138 characters). Maximum size is 5,000 characters (Related field: Formula)
The formula of the field is:
IF(OR(ISPICKVAL(Code__c,"SAP"),
ISPICKVAL(Code__c,"MBS"),
ISPICKVAL(Code__c,"SAD"),
ISPICKVAL(Code__c,"SADP"),
Account.cost__c ,
IF(OR(ISPICKVAL(Code__c,"SAC"),
ISPICKVAL(Code__c,"AEM"),
ISPICKVAL(Code__c,"CC"),
0,
IF( AND (OR( ISPICKVAL(Code__c ,"JR"),
ISPICKVAL(Code__c,"DR")),
NOT(ISPICKVAL(Account.Type__c,""))),
1400,
IF( OR(ISPICKVAL(Code__c,"AE")),
Account.cost__c/9,0))))


Can anyone please help me with this (or)  else can anyone suggest me how to use CASE function for this type of formula
 
Thanks,
krishnak2krishnak2
Hi Prakash,

This is a compile size error. It basically  means that there are either complex formula or too many formula. Please refer to this link (https://resources.docs.salesforce.com/204/latest/en-us/sfdc/pdf/salesforce_formula_size_tipsheet.pdf)for additional information.Also for the formaul you posted  try using CASE function.