4

This question might be confusing but I wasn't sure how to word it. SP accepts the syntax fine and the validation stops incorrect data from being submitted, but won't let me progress after fixing what would cause an error. Here's the validation (simplified - [Supplier] is a Choice, [Codes] is a single line of text):

=IF(
    AND(
        OR(
           [Supplier]<>"ABC",
           [Supplier]<>"DEF"
        )
        ISBLANK(
                [Codes]
        )
    )
  FALSE,
  TRUE
)

So the syntax is accepted by SP. Now when I go to submit a new item in the list and select [Supplier] "XYZ", I will get an error that says "you must insert [Codes] if not "ABC" or "DEF". If I enter [Codes] the process continues fine. However, if I change [Supplier] to "ABC" or "DEF", the validation will still tell me to enter [Codes].

So does the process of a validation looks only for a fix or change in a specific field after first trying to validate, or does it run through the whole process again (in which case, it should pick up that I've changed [Supplier] to "ABC" and remove the need to fill out [Codes])?

4

Try changing OR by AND.

=IF(
    AND(
        AND(
           [Supplier]<>"ABC",
           [Supplier]<>"DEF"
        )
        ISBLANK(
                [Codes]
        )
    )
  FALSE,
  TRUE
)
  • This seems to work, but I thought AND checks to see if all conditions are true and OR checked if at least one was true. Why does this work this way? Maybe I'm just thinking about the logic wrong. Either way, thank you! – Paxman Jul 11 '17 at 22:16
  • It works as you say. I think logic was wrong. You need an AND. – Juan Pablo Pussacq Laborde Jul 12 '17 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.