Validation between two text fields for entry I have a business case where our back office team enters state witholding information. Some states use letters (A-F) and some use numbers. I have both fields built but I want validation that makes it possible that if a letter is entered in the letter field that a number cannot be entered in the number field.

  • 2
    Trailhead has a solid module on validation rules, which is the functionality you need to make this possible.
    – David Reed
    Jan 31, 2018 at 20:13

1 Answer 1


That's as simple as:

NOT(ISBLANK(Text_Field__c)) && NOT(ISBLANK(Number_Field__c))

If both fields are not blank, then display an error. As an alternative, you can also write:

NOT(ISBLANK(Text_Field__c) || ISBLANK(Text_Field__c))

Which uses something known as "De Morgan's Laws": NOT A AND NOT B can be written as NOT (A OR B), and NOT A OR NOT B can be written as NOT (A AND B).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .