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
Synthia BeauvaisSynthia Beauvais 

Error: Compiled formula is too big to execute

I am getting Error: Compiled formula is too big to execute (6,166 characters). Maximum size is 5,000 characters for the formula below. How can I correct this? 
 
IF( RecordTypeId='012700000009OvZAAU',
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "& 
IF( ISBLANK( Name), "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( ISBLANK( BillingStreet), "Street, ","")&""&
IF( ISBLANK( BillingCity), "City, ","")&""&
IF( ISBLANK( BillingState),  "State, ","")&""&
IF( ISBLANK( BillingPostalCode),  "Postal Code, ","")&""&
IF( ISBLANK( BillingCountry), "Country, ","")&""&
IF( ISBLANK( NumberOfEmployees ),  "Number Of Employees, ","")&""&
IF( ISBLANK( DunsNumber), "Duns Number, ","")&""&
IF( ISPICKVAL( Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL( Segment_2__c,""), "Segment,","")),

IF(RecordTypeId='012700000009OvoAAE' ,
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "&
IF( ISBLANK( Name), "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( ISBLANK( BillingStreet), "Street, ","")&""&
IF( ISBLANK( BillingCity), "City, ","")&""&
IF( ISBLANK( BillingState),  "State, ","")&""&
IF( ISBLANK( BillingPostalCode),  "Postal Code, ","")&""&
IF( ISBLANK( BillingCountry), "Country, ","")&""&
IF( ISBLANK( NumberOfEmployees ),  "Number Of Employees, ","")&""&
IF( ISBLANK( DunsNumber), "Duns Number, ","")&""&
IF( ISPICKVAL( Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL( Segment_2__c,""), "Segment,","")&""&
IF( ISBLANK( NaicsCode ), "NAICS Code, ","")&""&
IF( ISBLANK( Servicing_Division__c), "Servicing Division, ","")),""))

 
Best Answer chosen by Synthia Beauvais
John Pipkin 14John Pipkin 14
If the data quality score is showing 0 and the data quality score description is blank, then the original criteria of the recordtypeid is not true. This can happen when creating a record type in sandbox and moving to production. I, personally, never use RecordTypeId. Instead I put 
IF(RecordType.Name = 'My Record Type Name', .... , ....)

That way, you are looking for the record type name instead of id. Its a bit more reliable and it is easier to read. 

All Answers

Krishna SambarajuKrishna Sambaraju
You can use this formula in a workflow field update. Create a custom field, then create a workflow rule and a field update to update this custom field. In the field update use the above formula to update the custom field. That should work.

Kind Regards,
Krishna.
Praveen Kumar SharmaPraveen Kumar Sharma
Hi,

Try removing the spaces between the brackets and the field API Name or a;so remove any space after the end of line.

Hope it helps.

Regards
John Pipkin 14John Pipkin 14
IF(OR(RecordTypeId='012700000009OvoAAE',RecordTypeId='012700000009OvZAAU'),
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "&
IF( ISBLANK( Name), "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( ISBLANK( BillingStreet), "Street, ","")&""&
IF( ISBLANK( BillingCity), "City, ","")&""&
IF( ISBLANK( BillingState),  "State, ","")&""&
IF( ISBLANK( BillingPostalCode),  "Postal Code, ","")&""&
IF( ISBLANK( BillingCountry), "Country, ","")&""&
IF( ISBLANK( NumberOfEmployees ),  "Number Of Employees, ","")&""&
IF( ISBLANK( DunsNumber), "Duns Number, ","")&""&
IF( ISPICKVAL( Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL( Segment_2__c,""), "Segment,","")&""&
IF(RecordTypeId='012700000009OvoAAE',
IF( ISBLANK( NaicsCode ), "NAICS Code, ","")&""&
IF( ISBLANK( Servicing_Division__c), "Servicing Division, ",""),""),""))

Hope that helps
Synthia BeauvaisSynthia Beauvais
Hi John! 

I am getting "Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4" with your formula. Any thoughts? 
John Pipkin 14John Pipkin 14
Those pesky parenthesis! 
IF(OR(RecordTypeId='012700000009OvoAAE',RecordTypeId='012700000009OvZAAU'),
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "&
IF( ISBLANK( Name), "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( ISBLANK( BillingStreet), "Street, ","")&""&
IF( ISBLANK( BillingCity), "City, ","")&""&
IF( ISBLANK( BillingState),  "State, ","")&""&
IF( ISBLANK( BillingPostalCode),  "Postal Code, ","")&""&
IF( ISBLANK( BillingCountry), "Country, ","")&""&
IF( ISBLANK( NumberOfEmployees ),  "Number Of Employees, ","")&""&
IF( ISBLANK( DunsNumber), "Duns Number, ","")&""&
IF( ISPICKVAL( Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL( Segment_2__c,""), "Segment,","")&""&
IF(RecordTypeId='012700000009OvoAAE',
IF( ISBLANK( NaicsCode ), "NAICS Code, ","")&""&
IF( ISBLANK( Servicing_Division__c), "Servicing Division, ",""),"")),"")

That should compile. Let me know if it doesn't
Synthia BeauvaisSynthia Beauvais
Thanks, John!  I figured it out before you sent this response. But now I have a new problem. There is no Syntax error however, the formulas below are not calculating. Any thoughts? 

Data Quality Score
IF( RecordTypeId='012700000009OvZAAU',
IF( ISBLANK( Name),0,0.5)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.5)+
IF( ISBLANK( BillingStreet ),0, 0.5)+
IF( ISBLANK( BillingCity ),0,0.5)+
IF( ISBLANK( BillingState ),0,0.5)+
IF( ISBLANK( BillingPostalCode ),0,0.5)+
IF( ISBLANK( BillingCountry ),0,0.5)+
IF( ISBLANK( NumberOfEmployees ),0,0.375)+
IF( ISBLANK( DunsNumber),0,0.375)+
IF( ISPICKVAL(Preferred_Language__c,""),0,0.375)+
IF( ISPICKVAL(Segment_2__c,""),0,0.375),

IF(RecordTypeId='012700000009OvoAAE',
IF( ISBLANK( Name),0,0.384615385)+
IF( ISPICKVAL(Account_Vertical__c,""),0,0.384615385)+
IF( ISBLANK( BillingStreet ),0, 0.384615385)+
IF( ISBLANK( BillingCity ),0,0.384615385)+
IF( ISBLANK( BillingState ),0,0.384615385)+
IF( ISBLANK( BillingPostalCode ),0,0.384615385)+
IF( ISBLANK( BillingCountry ),0,0.384615385)+
IF( ISBLANK( NumberOfEmployees ),0,0.384615385)+
IF( ISBLANK( DunsNumber),0,0.384615385)+
IF( ISPICKVAL(Preferred_Language__c,""),0,0.384615385)+
IF( ISPICKVAL(Segment_2__c,""),0,0.384615385)+
IF( ISBLANK( NaicsCode ),0,0.384615385)+
IF( ISBLANK( Servicing_Division__c),0,0.384615385),
0))


Data Quality Score Description
IF(OR(RecordTypeId='012700000009OvoAAE',RecordTypeId='012700000009OvZAAU'),
IF( Data_Quality_Score__c =5,"All Contact Details Captured", "Missing: "&
IF( ISBLANK( Name), "Account Name, ","")&""&
IF( ISPICKVAL(Account_Vertical__c,""), "Account Vertical,","")&""&
IF( ISBLANK( BillingStreet), "Street, ","")&""&
IF( ISBLANK( BillingCity), "City, ","")&""&
IF( ISBLANK( BillingState),  "State, ","")&""&
IF( ISBLANK( BillingPostalCode),  "Postal Code, ","")&""&
IF( ISBLANK( BillingCountry), "Country, ","")&""&
IF( ISBLANK( NumberOfEmployees ),  "Number Of Employees, ","")&""&
IF( ISBLANK( DunsNumber), "Duns Number, ","")&""&
IF( ISPICKVAL( Preferred_Language__c,""), " Preferred Language,","")&""&
IF( ISPICKVAL( Segment_2__c,""), "Segment,","")
),
IF(RecordTypeId='012700000009OvoAAE',
IF( ISBLANK( NaicsCode ), "NAICS Code, ","")&""&
IF( ISBLANK( Servicing_Division__c), "Servicing Division, ",""),""))














 
John Pipkin 14John Pipkin 14
If the data quality score is showing 0 and the data quality score description is blank, then the original criteria of the recordtypeid is not true. This can happen when creating a record type in sandbox and moving to production. I, personally, never use RecordTypeId. Instead I put 
IF(RecordType.Name = 'My Record Type Name', .... , ....)

That way, you are looking for the record type name instead of id. Its a bit more reliable and it is easier to read. 
This was selected as the best answer