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
kuldeep paliwalkuldeep paliwal 

i have a problem regarding validation rule

Here is criteria my validation rule on "Lastname":--
1. No more than two consecutive repeating characters are allowed 
2. No symbols except for hyphen and apostrophe 
3. No digits 
4. Minimum length of two characters 
5. No leading spaces or special characters 
6. No spaces allowed on either side of a hyphen 
7. Single space allowed between text 
8. Must not contain initial(s) with the exception of ‘#’ 
9. For 'Last Name' field : Must not contain initials(s) with the exception of ‘#’ 
‘#’ acceptable only when following a single alphabetic character (e.g. ‘Last Name: Jane#’ is allowed) 

Here i write and want add point '9' too...:-
​OR( 
ISPICKVAL( Account.Type , "Sole Traders"), 
NOT( CONTAINS( LastName , "PTY Ltd") ) , 
LEN(LastName ) < 2 , 
NOT(CONTAINS(LastName , "-")) , 
NOT(CONTAINS(LastName , "'")), 
CONTAINS(LastName , ' ') , REGEX(LastName , "^[a-zA-Z0-9-/]*$") 
)
can any one help me...Thanx
NagendraNagendra (Salesforce Developers) 
Hi Kuldeep,

Please try this
OR( 
ISPICKVAL( Account.Type , "Sole Traders"), 
NOT( CONTAINS( LastName , "PTY Ltd") ) , 
LEN(LastName ) < 3 , 
NOT(CONTAINS(LastName , "-")) , 
NOT(CONTAINS(LastName , "'")), 
CONTAINS(LastName , ' ') , REGEX(LastName , "^[a-zA-Z0-9-/-@]*$") 
)

Thanks,
Nagendra