You need to sign in to do that
Don't have an account?

Error: Compiled formula is too big to execute
Hi All,
when I save the below formula, it shows this error:
Error: Compiled formula is too big to execute (19,959 characters). Maximum size is 5,000 character
if the sum of Value_1__c to Value_13__c <= 10, then display level 1
if the sum of Value_1__c to Value_13__c >10 and Value_1__c to Value_13__c <= 18, then display level 2
if the sum of Value_1__c to Value_13__c >18 then level 3
formula value:
if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 10
&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c ) <> 0 , "Level 1",
if( AND((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c + Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 10
&&
(Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) <= 18), "Level 2",
if((Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c) > 18,"Level 3",
"Level Not Calculated Yet" )))
All field Value_1__c to Value_13__c also formula field which get s the value from the picklist selected.
we tried this also:
total_risk_cal__c = Value_1__c + Value_2__c +Value_3__c + Value_4__c + Value_5__c + Value_6__c + Value_7__c + Value_8__c + Value_9__c+ Value_10__c + Value_11__c + Value_12__c + Value_13__c
if((total_risk_cal__c) <= 10
&&
(total_risk_cal__c ) <> 0 , "Level 1",
if( AND((total_risk_cal__c) > 10
&&
(total_risk_cal__c) <= 18), "Level 2",
if((total_risk_cal__c) > 18,"Level 3",
"Level Not Calculated Yet" )))
but getting same error.
Kindly tell how resolve this
Check this message where the same problem was discussed. Hope this solves the issue temporarily.
All Answers
First a quick explanation on formulas. In Salesforce, when a formula references another formula, the latter gets embedded into the former behind the scenes. Hence, we see:
But behind the scenes, it is:
This is why it becomes easier than expected to hit the 5000 character limit. It is also why your second attempt didn't help.
How to solve? To the best of my knowledge you can't get around the 5000 character limit. And at 20K of characters, it is a pretty safe bet you aren't going to figure out a way to write a 4x shorter formula.
Best I can think of doing would be to turn total_risk_cal__c into a Number field (a pure Number field, not a formula field which produces a number), then use either a workflow or a trigger to keep it up to date. You then should be able to use your second formula without any problems.
Good luck,
MellowRen
thanks for reply MellowRen im using PE
PE? **bleep**, that is not good. I do not have a solution for you there. Sorry mate, hopefully someone else might have an idea. Fingers crossed.
----- Edit -----
**bleep** ???? Ha ha ha ha, that's harsh. I did not use a word that I would consider vulgar at all. This auto-edit makes it look like I used the F - word or something.
I've come across this issue before and I actually had a work around on this, where I used a Workflow and Field Update. You might want to see if this is an option for you.
Big formulas are always a challenge. As ericmonte is suggesting - WF and WF-Actions are the only way around it. As your formula is substancially big.
The other way is throught Apex Coding. I had a similar issue and it took a while to get the logic working around to fit without Apex code. But, there is a limit to which you can push without Apex..
PS: Your work aroud will get bigger than you expect.
Timon
I had some thoughts, none of them ideal.
Best I can think of.
Regards
MellowRen
Check this message where the same problem was discussed. Hope this solves the issue temporarily.
thanks for reply guys