+ Start a Discussion
jgreene.ax1178jgreene.ax1178 

Validation Rule for Two Character States

Hey all, 

I have the following rule that works well:

AND(
NOT ISBLANK(MailingState),
LEN(MailingState )<>2
)


However, I need to exclude two record types called 'student' and 'professional' - how can I do that here without breaking the rule?

Thanks!
Best Answer chosen by jgreene.ax1178
Vinit_KumarVinit_Kumar
Try this one :-

AND(
NOT ISBLANK(MailingState),
LEN(MailingState)<>2,
RecordTypeId <>'15 digit student rec type id',
RecordTypeId <>'15 digit professional rec type id'
)


All Answers

Pavan Kumar KajaPavan Kumar Kaja
Hi,

Try below one.

AND(
NOT ISBLANK(MailingState),
LEN(MailingState )<>2,
RecordTypeId !='15 digit student rec type id',
RecordTypeId!='15 digit professional rec type id'
)


jgreene.ax1178jgreene.ax1178
Hey there!  Thanks for the suggestion, but I'm getting the syntax error of 'Missing ')' 


Vinit_KumarVinit_Kumar
Try this one :-

AND(
NOT ISBLANK(MailingState),
LEN(MailingState)<>2,
RecordTypeId <>'15 digit student rec type id',
RecordTypeId <>'15 digit professional rec type id'
)


This was selected as the best answer
jgreene.ax1178jgreene.ax1178
Looks like that worked!  No errors - thanks a bunch, @Vinit_Kumar.  Really am grateful!

-Jake