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
Dan Paul 9Dan Paul 9 

Getting around Text Length 255 by using formula and multiple fields

We are using a text field in apex, validation rules, flows etc.  Typically checking whether one value is contained in the text field.  Recently we had a requirement to go over the 255 character limit of a text field.  I had the idea to replace it with a series of text fields and then hide that by always referencing a formula field the combines them.  So this all *seems* to be working but my gut tells me I'm going to hit a brick wall somewhere, seems too good to be true :).  Does anyone know a restriction on this approach?
PradeepgorePradeepgore
Hi Dan,


There is no restriction but as salesforce is on multitenant architecture, we should use less storage by creating less fields.

Don't understand - replace textfield with a series of text fields and then hide that by always referencing a formula field the combines them - Why not use long text area as a single field ?

Limitations of using series of fields:

1. The number of fields you use is proportional to the time taken for execution: More CPU time execution of components where formula field is leverage.
2. Additional task to give Field Level Security(FLS) for new series of fields,adding it to the deployment checklist - Wastage of resource time
3. Wastage of storage
4. Debugging time for formula field if something goes wrong in future.

There might be more, but I foresee all above. Finally, if this interrupts the business don't make the change.

Needles to say if you find this helpful mark as best to guide future visitors.
Additionally, we can connect on pradeepgore60@gmail.com

Thanks,
Pradeep