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
srikanth sfdcsrikanth sfdc 

Starting letter to be alphabet using validation rule

Hi All,

In Accounts Tab, we have Name field , so here i need a validation rule that when i enter name in AccountName field the first letter it should be allowed letter not the numbers or special characters

Example

Account Name - Rakesh    (correct format)
Account Name - rakesh     (correct format)
Account Name - R12@   (Correct format)
 Account Name - r12@   (Correct format)
Account Name - 1Rakesh   (wrong format)
Account Name - #12@   (Wrong format)


as here first letter should be letter (mandatory) when i enter from second letter its up to users wish as number or specials characters can be taken
Sonam_SFDCSonam_SFDC
Use the LEFT(text, num_chars) (https://help.salesforce.com/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#LEFT) to get the first letter of the Account name and then compare it to all thre aplhabets to see if it one else throw an error.
Ramu_SFDCRamu_SFDC
You would need to use regex in validation rule to ensure that the first letter is an alphabet. The below post helps you out with the regex expression to use.

http://stackoverflow.com/questions/3690855/regular-expression-related-first-character-alphabet-second-onwards-alphanumeric
Madhan Raja MMadhan Raja M
Hi Srikanth,

Try the below validation code:

NOT(REGEX(Name, "[a-zA-Z]{1}.*"))

Regards,
Madhan Raja M
srikanth sfdcsrikanth sfdc
thanks frnds