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
Marco_MaltesiMarco_Maltesi 

Validation rule TEXT

hi!!!

i need a validation rule for an field that does not begin with a capital letter!!!

i write this

NOT  BEGINS( Name ,"A") but i can t add the other letters

thanks for help!!

kcpluspluskcplusplus

How about this:

 

UPPER(LEFT(text_field__c,1)) = LEFT(text_field__c,1)

goabhigogoabhigo

Hey, try REGEX()

 

So the validation rule will look something like this: NOT( REGEX(LEFT(Name,1), "[A-Z]") )

 

https://login.salesforce.com/help/doc/en/fields_useful_field_validation_formulas.htm

http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html

 

Marco_MaltesiMarco_Maltesi

hi!!

thanks a lot!!

so ,there is many solutions

i use this one:

""UPPER(LEFT(Name,1)) & LOWER( Mid(Name,2,79))""

 it works good!!

but i can do it for the composite firt name:::like ::: jean_françois!!!

its done only Jean_françois

and the correct form is Jean_François!!

is there an optimazed solution::

thanks for help

*rdinakaran**rdinakaran*

Hi,

Use the Below Expression. It is also works.

NOT(REGEX( MyField__C , 

"^[A-Z]+[a-zA-Z]*$"))

atallatall

Hi RajaDinakaran

 

I've used your regex function but observed that it is not allowing valid data (ex: Anil_Talluri) or invalid data (Anil_talluri or anil_Talluri etc)

 

Please help me in this regard as I too have the same requirement.

*rdinakaran**rdinakaran*

Hi atall,

 

Try this it works for your requirement

 

NOT(REGEX( MyField__C , 

"^[A-Z][a-zA-Z0-9_-]*$"))

 

 try this and let me know it works.

 

Thanks