You need to sign in to do that
Don't have an account?
Rachel Linder 20
Receiving Compile Size Error When Creating a New Formula Field
I am creating a formula field that is totally 4 other formula fields and receiving the following error: "Error: Compiled formula is too big to execute (7,784 characters). Maximum size is 5,000 characters"
Here is the formula I am creating:
Here is what each one of the 4 formula fields above looks like:
ARR NEW (Compiled Size: 730 Characters)
Here is the formula I am creating:
ARR_New__c + ARR_Price_Change_RN__c + ARR_Quantity_Change_RN__c + ARR_Removed__cHow can I reduce the compile size?
Here is what each one of the 4 formula fields above looks like:
ARR NEW (Compiled Size: 730 Characters)
IF(ISPICKVAL(Opportunity.StageName,"Closed Lost"),0, If( AND (NOT (Line_Level_Detail__c='Services'), Line_Level_Type__c= 'New Product'), UnitPrice * Quantity , 0))ARR Price Change (RN) (Compiled Size: 2,738 characters)
If ( ISPICKVAL(Opportunity.StageName,"Closed Lost"),0, IF( AND( Line_Level_Type__c= 'Renewed Product', NOT(CONTAINS( Pricing_Method_Change__c, 'Block'))), Quantity *( UnitPrice - Renewed_Subscription_Net_Price__c), IF( AND( Line_Level_Type__c= 'Renewed Product', CONTAINS( Pricing_Method_Change__c, 'Block')), TotalPrice - Renewed_Subscription_Total_Amount__c, 0) ) )ARR Quantity Change (RN) (Compiled Size: 1,345 characters)
IF( ISPICKVAL(Opportunity.StageName,"Closed Lost"),0, IF( AND(Line_Level_Type__c='Renewed Product', NOT(CONTAINS( Pricing_Method_Change__c, 'Block'))), Renewed_Subscription_Net_Price__c *( Quantity - Quantity_Upon_Creation__c ),0))ARR Removed (Compiled Size: 2,925)
IF ( AND( (ISPICKVAL(Opportunity.StageName, "Closed Lost")), Line_Level_Type__c <> 'New Product'), Combined_Renewed_Subscription_Total_Amt__c *-1, IF ( AND( Line_Level_Type__c = 'Removed Product', Opportunity_Record_Type__c = 'Amendment', Line_Level_Detail__c <> 'Services'), TotalPrice, IF ( AND ( Line_Level_Type__c = 'Removed Product', Opportunity_Record_Type__c = 'Renewal'), Combined_Renewed_Subscription_Total_Amt__c *-1,0) ) )
Line_Level_Detail__c and Line_Level_Type__c are very likely also formulas because the compiled size are impressive for these simple tests.
Are they formulas?
- Pricing_Method_Change__c - formula
- Combined_Renewed_Subscription_Total_Amt__c - formula
- Renewed_Subscription_Net_Price__c - formula
The current formulas are perfect (including the first sum) for the clarity but the several calls of the three fields above must be reduced as far as possible because the compiler of the formulas is not clever and cumulates the code of the sub-formulas for each call.A big unique formula with all the tests and the miminal number of calls for the formula fields (very consuming) could be tried.
A big unique formula: instead of:
But even with a big unique formula (given that the tests are not very heavy in the compiled formula and if the number of use of the formula fields remains the same), the final size could be still too big;
The last option in that case is to update via process builder other fields (bad news) that will be not formulas anymore.