Edit CHECK to make sure that data exists only in one field

kristiakkristiak Posts: 1,223 ✭✭✭
I have two variables that should not be entered if two other variables exist. I.e if B and C exist than D and E must be empty, or vis versa if D and E exist than B and C must be empty! I have tried using show and hide and that works fine until you go back and change one of the pairs without deleting the two other. An edit check that would not allow this would be welcome! I can easily check that after the fact but it is a common error so I would prefer preventing it during data entry:
Anyone with an idea???
Tagged:

Comments

  • ebsebs Posts: 95
    edited July 3
    We use rules to handle that.

    An empty field can be checked using FIELD_NAME eq ""

    A populated field can be checked using FIELD_NAME ne ""

    So to check that Field D is populated when it shouldn't be:

    FIELDB ne "" and FIELDC ne "" and FIELDD ne ""

    Then another rule for Field E

    FIELDB ne "" and FIELDC ne "" and FIELDE ne ""

    and so on to cover the various scenarios

    Cheers
    Eric
  • kristiakkristiak Posts: 1,223 ✭✭✭
    That looks smart. Can you use this syntax in e the validation columns so it fires immediately when you save the data or is that's where you handle the rule?
  • ebsebs Posts: 95
    The syntax is used in the rule expression field in rules designer. We use a Discrepancy Note action so that the user is shown an alert on saving the data and given a chance to correct it.
  • kristiakkristiak Posts: 1,223 ✭✭✭
    via Email
    Thanks Eric, I will try that!

    Best regards

    Krister
  • kristiakkristiak Posts: 1,223 ✭✭✭
    Sorry Erik could you please send me an example how this rule would be designed.

    Regards

    Krister
Sign In or Register to comment.