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
Bharathkumar 3Bharathkumar 3 

Limit a Text formula to 56 characters. please help with the syntax

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Bharath,

Is it just the text field or formula field on which we need to add the validation rule?

Thanks,
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Bharath,

The validation rule formule will be simple as below.
 
LEN( Text_formula_for_validation__c ) >56

If this solution helps, please mark it as best answer.

Thanks,
 
CharuDuttCharuDutt
Hii Bharat Kumar
Try Below validation Or Formula
Validation Rule:LEN( FormulaFieldName ) >56

Or Use In Formula

Formula: IF(LEN( FieldName ) <= 56,FieldName ,'')
Please Mark It As Best Answer If It Helps
Thank You!
Brian Hayes 12Brian Hayes 12
This formula does not meet the stated need: IF(LEN( FieldName ) <= 56,FieldName ,'')

This formula does:
IF(LEN(FieldName) <= 56,FieldName ,LEFT(FieldName, 56))

If you would like to indicate to the user that the value has been truncated, you can do something like this:
IF(LEN(FieldName) <= 56,FieldName ,LEFT(FieldName, 53) & "...")

Replace FieldName the the appropriate field API name.