You need to sign in to do that

Don't have an account?

Soledad Angel

# Compile error

Hi,

I am trying to do some forecasting, so I created Head count (#) and a Revenue field (formula, rate * Head count * Probability) and now I need to calculate impact on FY.

My formula is very basic (see below), the issue is that I can only go to 9, not to 12 as needed, I get the error "too large to compile".

Suggestions?

_________________________

CASE(

ROUND((( DATEVALUE( "2015-04-01" ) - CloseDate ) / 30 ), 0 ),

1, WRM_1__c ,

2, ( WRM_1__c + WRM_2__c ) ,

3, ( WRM_1__c + WRM_2__c + WRM_3__c ) ,

4, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c ) ,

5, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c ) ,

6, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c + WRM_6__c ) ,

7, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c + WRM_6__c + WRM_7__c ) ,

0

)

I am trying to do some forecasting, so I created Head count (#) and a Revenue field (formula, rate * Head count * Probability) and now I need to calculate impact on FY.

My formula is very basic (see below), the issue is that I can only go to 9, not to 12 as needed, I get the error "too large to compile".

Suggestions?

_________________________

CASE(

ROUND((( DATEVALUE( "2015-04-01" ) - CloseDate ) / 30 ), 0 ),

1, WRM_1__c ,

2, ( WRM_1__c + WRM_2__c ) ,

3, ( WRM_1__c + WRM_2__c + WRM_3__c ) ,

4, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c ) ,

5, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c ) ,

6, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c + WRM_6__c ) ,

7, ( WRM_1__c + WRM_2__c + WRM_3__c + WRM_4__c + WRM_5__c + WRM_6__c + WRM_7__c ) ,

0

)

Soledad AngelSolved it.

The only work around is to split formula in non-formula fields and reference to those. The non-formula fields are updated thanks to field update workflows, which do include the formulas needed. Once that is done, it is easy to obtain the result.

So, in this case,

1) Created a formula field: "Month in Year" : ROUND((( DATEVALUE( "2015-04-01" ) - CloseDate ) / 30 ), 0 )

2) Created number field"First half year" and "second half year" :

3) Created Workflows with field update actions: that includes the formula pasted above for "first half year", and the subsequent numbers (7-12) for "second half year"

4) The final, needed, formula: would be ( " first half year " + " second half year" )

## All Answers

Shyam BhundiaThis might help:

"This limit is the same for all Salesforce editions: Maximum formula size (in bytes) when compiled: 5,000 bytes. When your formula exceeds this limit, the error message says, “Compiled formula is too big to execute (13,974 characters). Maximum size is 5,000 characters.”

Check out this document on tip to reduce the size https://help.salesforce.com/help/pdfs/en/salesforce_formula_size_tipsheet.pdf

Soledad AngelSolved it.

The only work around is to split formula in non-formula fields and reference to those. The non-formula fields are updated thanks to field update workflows, which do include the formulas needed. Once that is done, it is easy to obtain the result.

So, in this case,

1) Created a formula field: "Month in Year" : ROUND((( DATEVALUE( "2015-04-01" ) - CloseDate ) / 30 ), 0 )

2) Created number field"First half year" and "second half year" :

3) Created Workflows with field update actions: that includes the formula pasted above for "first half year", and the subsequent numbers (7-12) for "second half year"

4) The final, needed, formula: would be ( " first half year " + " second half year" )

Shyam Bhundiaawesome!