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
AviAfsAviAfs 

Issue with Production vs Sandbox formula size limit

Hi,
 
I wrote a formula on the Sandbox on picklist. (See case statement below).  On the sandbox the formula size is about 3000, but when I copy it to production it tells me I am over limit and the size is about 6000.  Why is that?  When I copied to word, that also tells me that size is 3000.  Please help.
 
CASE (   SelectAreaTeam__c ,
'A NorthEast Project','A NorthEast Project',
'Alabama Project','Alabama Project',
'Alaska','Alaska',
'Appalachian','Appalachian',
'Arkansas','Arkansas',
'Baltimore','Baltimore',
'Bay','Bay',
'Bergen County Catalyst','Bergen County Catalyst',
'Big Sky','Big Sky',
'California Central Coast','California Central Coast',
'Capitol','Capitol',
'Carolinas','Carolinas',
'Chicago Urban Sending','Chicago Urban Sending',
'Colorado Rockies','Colorado Rockies',
'Columbia Pacific','Columbia Pacific',
'DelMarPa','DelMarPa',
'Desert Valleys','Desert Valleys',
'Dirigo Maine','Dirigo Maine',
'Downeast Maine','Downeast Maine',
'East Metro','East Metro',
'East Texas','East Texas',
'Eastern NY','Eastern NY',
'E-Z Pass','E-Z Pass',
'Fairfield County Catalyst','Fairfield County Catalyst',
'Finger Lakes NY','Finger Lakes NY',
'Florida','Florida',
'Friends Across New England','Friends Across New England',
'Grand Canyon','Grand Canyon',
'Greater Chicago','Greater Chicago',
'Greater Cincinnati','Greater Cincinnati',
'Greater Cleveland','Greater Cleveland',
'Greater Dayton','Greater Dayton',
'Greater Illinois','Greater Illinois',
'Greater Los Angeles','Greater Los Angeles',
'Greater Puget Sound','Greater Puget Sound',
'Greater West Metro','Greater West Metro',
'Hawaii Catalyst','Hawaii Catalyst',
'Head of the Lakes','Head of the Lakes',
'Heartland KS','Heartland KS',
'Inland Empire','Inland Empire',
'Kansas City','Kansas City',
'Louisiana','Louisiana',
'Massachusetts Bay','Massachusetts Bay',
'Michigan','Michigan',
'Midland','Midland',
'Milwaukee','Milwaukee',
'Minn-Kota','Minn-Kota',
'Miss Tennky','Miss Tennky',
'Missouri Gateway','Missouri Gateway',
'Monmouth County Catalyst','Monmouth County Catalyst',
'New Jersey','New Jersey',
'New Mexico','New Mexico',
'North Central Tier NY','North Central Tier NY',
'North Central Wisconsin','North Central Wisconsin',
'Northeast Ohio','Northeast Ohio',
'Northern Chicago Catalyst','Northern Chicago Catalyst',
'Northern Illinois','Northern Illinois',
'Northern Texas','Northern Texas',
'Northwest California','Northwest California',
'Northwest Central','Northwest Central',
'Northwest Ohio','Northwest Ohio',
'Ohio River Valley','Ohio River Valley',
'Okazark','Okazark',
'Oklahoma','Oklahoma',
'One World','One World',
'Orange County','Orange County',
'Pacific Cascades','Pacific Cascades',
'Pine to Prairie','Pine to Prairie',
'Quad City Catalyst','Quad City Catalyst',
'San Diego','San Diego',
'Sierra San Joaquin','Sierra San Joaquin',
'Silver & Gold','Silver & Gold',
'South Texas','South Texas',
'Southern CA Mtn & Desert','Southern CA Mtn & Desert',
'Spokane Catalyst','Spokane Catalyst',
'Steinbeck Coast','Steinbeck Coast',
'Team 500','Team 500',
'Texas Gulf Coast','Texas Gulf Coast',
'The Grand South','The Grand South',
'Virginia','Virginia',
'Visit Michigan','Visit Michigan',
'Wasatch-Teton','Wasatch-Teton',
'Waukesha and West','Waukesha and West',
'West Texas','West Texas',
'Western NY','Western NY',
'Western PA','Western PA',
'World Class','World Class',
'World Flags','World Flags',
""
)
rpr2rpr2
Is there more to the formula than this case statement?  If the formula refers to a custom field which in turn is a formula, the compile size is the sum of all formulas referenced by each field that is part of the formula - so adding a reference to just one more field could potentially double the compile size.
AviJhaAviJha
Yes there is another field.  But that same field is on the Sandbox also.  I created test object on Sandbox and copying it to production.  It runs fine on the Sandbox, but on the production it gives text size error.  So is the way it counts the char(s) on Sandbox is different than on the production.
 
Thanks for your help.
 
JohanLiljegrenJohanLiljegren
It could have to do with the order in which you've input the formulas in sandbox.
We were unable to transfer a formula field the other week and we finally figured it out.

Let's say FieldA includes the value of FieldB.
If you first create FieldB as empty (or very limited), then create FieldA and include that field + a bunch other stuff, everything is fine.
You can now go in to FieldB and add a lot of formulas without problem.
Had you done it the other way around, you wouldn't had been able to save FieldA once you include FieldB.

I hope I'm making sense here, it's kind of hard to explain without drawing a picture. =)

Regards
//Johan