Ask Search:
Chris JohnsChris Johns 

Validation Rule text field mandatory if text in another field

Hi

I would like to make a validation rule that says if first name is entred surname must be mandatory.

Any help would be great both are text fields

Thanks
Maxim MakarenkoMaxim Makarenko
Hi Chris,
How about
IF(
   NOT(ISBLANK(FirstName)),
   ISBLANK(LastName),
   0
)
Chris JohnsChris Johns
This does not work
Maxim MakarenkoMaxim Makarenko
My bad, how about now
IF(
   NOT(ISBLANK(FirstName)),
   ISBLANK(LastName),
   FALSE
)
And obviously, don't forget to change field names to your proper API names
Steve MolisSteve Molis
Try this
AND(NOT(ISBLANK(FirstName)),
ISBLANK(LastName))

 
Maxim MakarenkoMaxim Makarenko
Chris, use Steve's version ^ instead of mine because that's how you write a validation rule. My mind was blanking (haha) last night, don't know why I went with IF =)