I have a requirement where in need to build a formula for country code and Product code. Formula which i have built has a length of 44000 char and i see the length allowed on formula field are 3900. Can someone suggest if there is any other workaround to get this done.


  • 1
    You may have to write a trigger to update the field. – Raul Mar 21 '17 at 6:55
  • Thanks for the reply Rahul. Apart from customization can this be achieved through general configuration? – Vipin Mar 21 '17 at 7:00
  • post your formula here and we can try to optimize it – o-lexi Mar 21 '17 at 18:01

You can bypass that limit to have a limit of 5000 (compiled size) chars, by externalizing all long strings to custom labels

Example where you can do that :

Without custom label : CONTAINS('Value1,Value2,...ValueN',valueToCheck)

With custom label : CONTAINS($Label.myCustomLabel,valueToCheck)

If you can't achieve that with a custom label, then you'll need to create a new formula field to split your formula into two (<3900), and have the 5000 compiled limit size

| improve this answer | |

You can achieve the functionality using below approach : -

  1. Create Long Text Area If the output of the formula ix Text based otherwise create field as per your requirement.
  2. Need to incorporate trigger to calculate formula which you are trying in the formula field.


you can write a workflow to update the field providing the same logic in field update. This will work only if your field is not of type Checkbox, Picklist etc.

Yes you can go for workflow, but the character limit is 5000.So based on your requirement you need to select the approach.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.