Salesforce IdeaExchange
Formula limitations - length of formula and compiled size
It will be good to get rid of formula limitations.
1. The length of text that the formula can have is 1300 characters.
Due to this limitation, I had to split my formula in to two or more variables - write the first part of the formula in the 1st variable, write a 2nd variable to refer to the 1st variable and continue with the rest of the formula, etc.
2. Max size of compiled formula is 5000 character.
I think when you refer another formula in your formula, there is a limitation is the size after compilation.
3. when the same formula field is referred more than once in a formula, the compilation happens to translate the formula as many times as it's called.
Example:
Formula1_Field=IF (1<2><3>))
In this case, when Formula2_Field is compiled it translates Formula1_Field twice. In my real case, CASE statement cannot be written when you are checking for multiple expressions.
34 Comments » Posted by nit
Posted 08/02/07
Categories: Customization, Force.com Platform, Release Spring 08, Administration & Sharing
|
WrogWrog 08/03/07 |
Why not request this again? Maybe THIS time they will stretch the limit a bit more. |
|
UK_Clive 10/03/07 |
Merged Idea
originally posted 11/27/06
Bigger Formulas
Bigger Formulas
|
|
mmsheridan 10/03/07 |
Merged Idea
originally posted 03/08/07
Increase Size of Custom Formula Fields
The size of the custom formula fields only increased to 1300 characters with Spring Release. This may seem like a lot but we are still running into problems. I don't think there should be a limit but 2,000 characters would solve our problems.
|
|
Jeff@AIR 10/03/07 |
Merged Idea
originally posted 09/13/07
Vote to Eliminate Character Limits for Formula Fields
Did You Know?
Salesforce Formula Fields have a character limit. It is very frustrating for a powerful tool to be limited by something as easy to create as server space. The character limit makes many practical applications of this feature impossible, and so we do not even consider it as a solution when we are confronted with unique challenges. Vote Today to make your "Success On Demand" Jeff@AIR |
|
RK 10/03/07 |
Merged Comment originally posted 09/20/07 |
|
Jeff@AIR 10/03/07 |
Merged Comment
originally posted 09/25/07
Thanks for clarifying -
I am referring to the Character limit |
|
Greg W San Francisco, CA 10/03/07 |
Merged Idea
originally posted 10/05/06
Get Rid of Limitations on Formula Fields
There is a limit of something like 4000 SQL entries.... Is it possible to get rid of this limitation by buying unlimited edition or just removing it all together?
|
|
OSJMgr 10/03/07 |
Merged Comment
originally posted 10/08/06
No more banging my head against the wall while re-writing formulas to make them smaller!
|
|
CKZhou 10/03/07 |
Merged Comment
originally posted 10/18/06
I still get error msg on this? Formula is too long.... exceeds 1000 characters....?
|
|
Lori_ 10/03/07 |
Merged Comment
originally posted 10/25/06
Ditto, CKZhou
|
|
TxPartner 10/03/07 |
Merged Comment
originally posted 11/08/06
Was told this was being addressed in Winter 07 release
|
|
UK_Clive 10/03/07 |
Merged Comment
originally posted 11/17/06
This size limit is a real problem for us. Does anyone know what the size limit will be with Winter 07 ?
|
|
MattiasW 10/03/07 |
Merged Comment
originally posted 12/06/06
I have presented an idea at
http://ideas.salesforce.com/article/show/44348/Embedded_calculators_built_fro... or search ideas for "excel" which shows how you can use Excel to define formulas and just use them inside SalesForce. The limit will be in the range 5000-20000 cells. I am looking for feedback. |
|
EricB 10/03/07 |
Merged Comment
originally posted 12/10/06
First, the bad news: The "generated sql size" (compiled size) limit of 4K characters for custom formula fields still exists in Winter '07. But there is good news -- if you are an Enterprise or Unlimited Edition customer: you can define formulas in workflow field update actions that do not have this 4K limit. The reason this is possible is that Field Update actions store their results in a regular database field, rather than dynamically recalculating them (via SQL expressions) on every request.
|
|
JJohnson 10/03/07 |
Merged Comment
originally posted 01/20/07
I tried the extended formula field size in a workflow field update action in my Sandbox before the Winter '07 release and all worked well! I am now trying to do the same thing and I am getting "Value cannot exceed 1,300 characters." ???
|
|
EricB 10/03/07 |
Merged Comment
originally posted 01/27/07
There is still a size limit of 1300 characters on the formula expression itself. Just the compiled size limit of 4K goes away with workflow field updates.
|
|
WrogWrog 10/03/07 |
Merged Comment
originally posted 01/27/07
1000 characters may seem a lot, but I have run out on a coupe of occasions, even reducing my field names to 2 or 3 characters (which of course makes them hard to manage). Some functions (eg matching to picklist items) take up a lot of characters on their own, and I need to calculate some proprietary "scoring" for some customers based on the results of 20 custom fields.
I don't expect no limit at all, but 2000 would solve my problems completely. |
|
EricB 10/03/07 |
Merged Comment
originally posted 01/27/07
The limit will be increased from 1000 to 1300 characters in the Winter '07 release.
|
|
EricB 10/03/07 |
Merged Comment
originally posted 01/27/07
Changed status to Coming Soon.
|
|
SalesSupport 10/03/07 |
Merged Comment
originally posted 01/27/07
We are trying to track our expenses using salesforce.com. However, in order to do this correctly we need to enter codes for each expense item. We have been using "if, then" statements to accomplish this. We have reached our character limit but still have more codes to enter. Without being able to enter all the expense codes, we are not able to track out expense reports through salesforce.com. Any recommendations or suggestions?
|
|
mda_tera 11/28/07 |
Agreed! I am running into several issues with both character & compilation limits. I have several formula fields that are referenced in another formula field. I'm at 6000 characters and have already trimmed 200 characters off. It's a nested if statement and I can't find another way around it. I tried creating separate fields and referencing those, but I still hit the compilation issue. Argh! |
|
mscotton 12/18/07 |
Changed status to Coming in Spring 08. |
|
mscotton 12/18/07 |
Yes, we are listening! :-) We are planning to increase the formula field size limit from 1300 to 3900 characters in Spring '08. There will still be an overall compile size of 5000 characters (for formulas that reference other formulas), which is a database restriction (not something that we can change). |
|
TehNrd 12/27/07 |
Very cool. I guess if the 5000 limit (i hit this more than the character limit) is a database restriction that is too bad. Fortunately Apex can step up to the plate but formula fields are much easier to quickly setup and deploy. |
|
AlexCRMmanager Jan 3 |
Sounds like SFDC needs to borrow some computer geniuses from Google or someplace to help them get around the limitations of Oracle RAC... |
|
agluewvrs Jan 7 |
Not knowing the underlying database restrictions... it would be great if SFDC could publish a formula that could be used in a large nested formulas that only pulls in Values from other formula fields. Maybe something like: "VAL{Field Name}" So an example might be: Field1= 5+5 Field2= 10+10 Instead of= "(Field1)+(Field2)" (which equals 5+5+10+10) the user writes:"VAL(Field1)+VAL(Field2)" (which equals 10+20). This is probably a pipe dream because each formula would still need to be compiled somewhere right? but... would be nice. :) |
|
rachel09102007 Feb 1 |
I agree with the last comment. There must be a way for the fields to just look at the values. I came across the 5,000 character limit at was shocked. Customer support told me to look in the developers section to help "make my formulas smaller."(I thought that was funny) Well, I see that there is no magic shrinking machine available yet. |
|
kjoseph Feb 15 |
Changed status to Delivered. |
|
psantos Jun 12 |
I agree. We have dozens of formulas that have been setup for over a year. Suddenly they truncated the length and we are out of luck. |
|
mscotton Jun 17 |
Reply to psantos: - The 5000 character compile size limit is not new, so your formulas should never be truncated. Have you reported this to support? |
|
AlexCRMmanager Jun 24 |
I don't think this should be marked as "Delivered", since the compile size character limit is still 5000 characters. Read point 2 of the original idea. |
|
tim_diern Jul 29 |
Using workflow field updates instead does work well, but is really annoying as each record has to be edited in whatever way in order for the field to be updated. Mistakes are bound to happen because when looking for a value in a field people will not always remember to edit the record in order to get the right value. So, I strongly support the idea! Tim |
|
nikko Sep 23 |
I agreed that this should not be marked as Delivered. I'm still encountering the character limit issue and am stuck.. whether it's related to creating 1 formula or refering to another formula |
|
wbrown Oct 7 |
The 5000 character limit needs to be increased. It still limits the type of formulas and reporting my company needs to use on a daily basis. |
- wbrown
- nikko
- sandpcheryl
- heathermc
- travisr
- stokheim07172008
- tim_diern
- lorcanore
- miss_v
- shall02102008
- Francesco23
- datarzan
- spinner65
- cpierre
- Elley
- bradcurrier
- ShannonJohnson
- MattBerryman
- LeslieS
- cschow
- dschach@modelmetrics.com
- zedmarketing10152007
- agluewvrs
- shahinatcars
- BradR
- CThompson
- roland.massenet
- Gregory
- mwebb
- nayoub
- stevenguichard
- sh
- jcohen
- 06/27/2007_20:48
- sdingels@astaro.com
- TimMadigan
- tdarwm
- Jon_Atchison
- tarah
- smichael@algorithmics.com
- NickG
- jdizzle57
- SuzanneB
- brad123
- md
- tkez
- vanessa
- prisch
- DianeWI
- nsahney
- jparker@salesforce.com
- ilean
- Jocsan
- mda_tera
- soffsey
- dmk
- sunilkumar@nipisoft.com
- Robbert
- craskulinecz
- dwachtel
- ta_invisible
- Marc_Baizman
- henkhofmans
- Jeff@AIR
- mark2008
- EddieDial800
- Chrisr
- sfvince
- devon
- Loic
- OSJMgr
- tacpoint
- jisaac
- jenleighj
- cspires
- arronj
- MarkEVernon
- dlange@centerstance.com
- RK
- LogoJon
- Pramod
- fjw
- Antoinette
- Paul_Vine_@_salesforce.com
- Mhagey
- Luvara
- smoody
- brailm
- splashgordon
- NPM
- ollie123
- dipa194@aim.com
- Leyna
- Heros
- Dr_Faulk
- WrogWrog
- BrcdTrain
- ESR2
- nit
- MSheridan

If it is compiled length, I can see there to be some need to have a limit. Think of the bog on the servers if someone wrote a formula with 100 nested Or statements..