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
sfdc-admin-smsfdc-admin-sm 

Case function not working because it's going over 3900 character limit

Hello,

 

I am trying to assign a Region value to an Account based on the Shipping Address of the Account. My Case function (sample below) works when it does not go over the 3900 character limit:

 

CASE(ShippingCountry,
"Afghanistan", "EMEA",
"Åland Islands", "EMEA",
"Albania", "EMEA",
"Algeria", "EMEA",
"American Samoa", "APAC",
...)

 

However, with over 300 different countries, the complete function is over 8000 characters and will not save. How would I optimize this formula to work for all 300 different countries and keep the same functionality?

 

Please respond with specific formulas to help.

 

Thanks.

Marko LamotMarko Lamot

Hello,

 

I don't think you will be able to do this in formula - or at least with one formula.

One - not so nice workaround - would be to:

1) create first formula for first 150 countries

2) create second formula for second 150 countries

3) create a workflow rule that sets the region field based on result of formula_field_1 OR result of formula_field_2 

 

Otherwise your alternative could also be implementing the trigger where you would put this logic.

 

Btw: we usualy put countries in separate object country (country name, region,....) and then do lookups to those countries, when we have some attributes that accompanies country.

 

 

Aviator_07Aviator_07