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

Formula field is too big

Hi All,

    I have a below formula fields

Market Segment 1

Market Segment 2

Market Segment 3


where Market Segment 1 is


CASE ( MarketSpecialty__c ,
"Hospital-Breast Surgery","SURGERY",
"Hospital-Cardiac Anesthesia","ANESTHESIA",
"Hospital-Cath Lab","CARDIOLOGY",
"Hospital-CCU (Dedicated)","CRITICAL CARE",
"Hospital-General Surgery","SURGERY",
"Hospital-Hospitalist (Gen Med)","CRITICAL CARE",
"Hospital-Physical Med & Rehab","MSK",
"Hospital-Picu/Nicu","CRITICAL CARE",
"Hospital-Sports Med","MSK",


Market Segment 2 and Market Segment 3 has similar values and end result is

Market Segment = MarketSegment1__c & MarketSegment2__c & MarketSegment3__c


but now the problem is i want to add few more values to 


Market Segment 1,Market Segment 2 and Market Segment 3 but it's saying my formula is too big, initially i want to change this to picklist but i have some 1000+ reports which use these fields so i can't change it, any idea how to add few more values by reducing the formula field, any help is appreciated .






If you're in EE/UE, you can change your MarketSegment[n]__c fields from Formula(Text) to Text fields, and enter their values with similar formulas but using Workflow Rule Field Updates. Make them read-only on the page layout. Then your overall MarketSegment__c formula should work fine. If you're careful, you should be able to do this without disrupting field names and thus leave your reports intact.




    Thx for the reply, iam not quite sure how would you change the MarketSegment[n]__c from formula to text for example in Market Segment 1 would you change all the values which i have currently have to text like "ANESTHESIA" to text "ANESTHESIA" to text and so on....?, then in this case i will have some 100's of text fields from Market Segment 1, Market Segment 2, Market Segment 3 and what would i do with Market Segment , iam lil confused and i been thinking regarding this today but i couldn't find the solution to add some more values to the existing fields, your idea might work but iam not sure how to implement it.


You're still going to use your formula, you're just going to use it in a different place. Formula fields update whenever any of the referenced fields update. What you could do instead is have the field be updated by a workflow rule that fires whenever the record is saved. The Workflow Rule Action will be a Field Update, and you'll use your formula in the Field Update to get the correct value. If Workflow Rules and Field Updates are new to you, read up in Help & Training.





         Formula fields cannot be used in field updates, for example in my case for picklist field Marketspeciality__c i need to add one more picklist vaule called "Hospital-Pain Mgmt" i can easily add these to the picklist field but when the user selects this value then "Pain Mgmt" from formula field market segment has to be selected , my issue is since the formula field is big enough i cannot add "Pain Mgmt" to Market segment[n] so iam selecting WFR according to you and iam saying Marketspeciality = "Hospital-Pain Mgmt" but here in the field update i cannot write any formula , iam not sure if this is what you excatly mean, but thx for your help, i appreciate if you could solve this .