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
sagar077sagar077 

Hi Everyone,Please help in this formula fields.. .

Hi Everyone help me with this error,

 I am using this formula on the quote object but getting an error -- Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (6,019 characters). Maximum size is 5,000 characters (Related field: Formula) 

AND(OR(ISPICKVAL(SBQQ__Type__c ,"Amendment"), ISPICKVAL(SBQQ__Type__c ,"Renewal")),
IF(Quantity_Of_Ischemic_Stroke_Family__c >  SBQQ__Opportunity2__r.Source_Opportunity__r.SBQQ__PrimaryQuote__r.Quantity_Of_Ischemic_Stroke_Family__c,true,

IF(Quantity_Of_Cerebral_Aneurysm_Family__c >  SBQQ__Opportunity2__r.Source_Opportunity__r.SBQQ__PrimaryQuote__r.Quantity_Of_Cerebral_Aneurysm_Family__c,true,

IF(Quantity_Of_Hemorrhagic_Stroke_Family__c > SBQQ__Opportunity2__r.Source_Opportunity__r.SBQQ__PrimaryQuote__r.Quantity_Of_Hemorrhagic_Stroke_Family__c,true,

IF( Quantity_Of_Support_Family__c >  SBQQ__Opportunity2__r.Source_Opportunity__r.SBQQ__PrimaryQuote__r.Quantity_Of_Support_Family__c,true,

IF( Quantity_Of_Synchronized_Care_Family__c > SBQQ__Opportunity2__r.Source_Opportunity__r.SBQQ__PrimaryQuote__r.Quantity_Of_Synchronized_Care_Family__c,true,false))))))
 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sagar,

>> https://salesforce.stackexchange.com/questions/245492/formulas-that-reference-this-field-are-no-longer-valid-compiled-formula-is-to

As mentioned in the above link If you did this in workflow with a field update, the formula is unlimited in size. The main drawback to this approach is that the data only updates when the item is updated while formula fields 'update' when they are accessed.

Set the workflow to always fire. let it take all of the data and calculate a response and update a standard field. (resultA)

Then use the formula field to compare that result (resultA) with the items that change as the day changes. (for example: 'days between A and Z < 14' etc)

This way you can have a single call in the formula to a standard field.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
SwethaSwetha (Salesforce Developers) 
HI Sagar,
Are you referencing any other formula fields in this formula? Salesforce counts every character used to create source fields for formula and the enforced limit is 5,000 characters.

Recommend reviewing Solutions listed in the link https://www.crmverse.com/four-solutions-to-salesforce-com-too-big-to-execute-formula-error/  to fix  "Too Big To Execute" Formula Error

> You can try Shortening API Names
> Use workflow field updates
> Use CASE Instead Of Nested IFs

For example:
Discount = IF( Type = "Consumer", 10%, IF( Type = "Reseller", 30%, 0 ) )
Nested IFs generally result in large compiled sizes. Salesforce.com provides a CASE statement to accomplish the same thing but with smaller resulting sizes.
Discount = CASE( Type, "Consumer", 10%, "Reseller", 30%, 0 )

See related links for similar scenarios: 
https://salesforce.stackexchange.com/questions/245492/formulas-that-reference-this-field-are-no-longer-valid-compiled-formula-is-to
https://developer.salesforce.com/forums/?id=9060G000000MSM9QAO
https://trailblazers.salesforce.com/answers?id=9063A000000t0YkQAI
https://salesforce.stackexchange.com/questions/72751/compiled-formula-is-too-big-to-execute-reduce-formula-size

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Andrew GAndrew G
As noted, the length of the formula is the issue.  The long object path and long field names all add up.  Even if you try breaking into separate formula fields, the length is not reduced - the formula length calculation will include the formula length of any fields that are used in the new formula.  i.e.  If FieldA is a formula that is 200char long, if you reference FieldA in a formula in FieldB, the 200 chars are included into to FieldB formula length calculation.

Possible work-around could be to create a Before - Save Triggered Flow.  Have it do a query to the object and then set the fields in your current quote record.  They would then be available for saving or validation.

regards
Andrew
sagar077sagar077
Hi Swetha,
 Can u plz help me with this formula i am getting error of 5000 again

IF(AND((ISPICKVAL(SBQQ__Type__c ,'Amendment'))
,IsUpSell__c = true),Annual_Subscription_Fee_new__c-Cross_Sell_Revenue__c-Expansion_ARR_Revenue__c,

IF(AND((ISPICKVAL(SBQQ__Type__c ,'Renewal')),IsUpSell__c = true),Annual_Subscription_Fee_new__c-Cross_Sell_Revenue__c-Expansion_ARR_Revenue__c,null))

plz help me