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
kjunkjun 

Numerical Field Value Greater 25


I have a numerical field type with the following api name in the account object:
Clause__c
I need a validation rule that if a user enters a value less than 25, they should see an error message on Save. Is this possible to do? Thank you in advance!
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi 

Try with below rule.
AND(NOT(ISBLANK(Clause__c)),LEN(Clause__c)<25)

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​
kjunkjun

Hello, Here is  error message: 

Error: Incorrect parameter type for function 'LEN()'. Expected Text, received Number

 

AnkaiahAnkaiah (Salesforce Developers) 
What is the data type of Clause__c field. Please check and confirm.

If it is number data type then max length=18.

Thanks!!
kjunkjun
Also, I'm not trying to find or edit the number of characters in the field. 
AnkaiahAnkaiah (Salesforce Developers) 
Try with below rule.
AND(NOT(ISBLANK(Clause__c)),LEN(Text((Clause__c)))<25)

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​
kjunkjun

Here is error on page when I test the field by entering a number greater than 25. This also happens if I enter any number below 25. 

User-added image

AnkaiahAnkaiah (Salesforce Developers) 
Can you go to the object manager --> select account object --> click on fields & relationships --> find the Clause__c field and check the datatype & length.

Thanks!!
kjunkjun

I figured it out. 

 

Clause__c <= 24