1

I created this Validation Rule that when a user selects Yes from the, Any_other_liens_filed_against_you__c picklist but tries to save the record without completing the text field, "If_Yes_What_liens_are_field_against_you__c", the error message will prompt the user to go back and complete the text field.

AND( 
    ISBLANK( If_Yes_What_liens_are_field_against_you__c ), 
        ISPICKVAL( Any_other_liens_filed_against_you__c , "Yes") 
)

What I'm trying to solve is, what if the picklist field, Any_other_liens_filed_against_you__c, doesn't need to be selected BUT a user decides to place any random text into the "If_Yes_What_liens_are_field_against_you__c" text field and is allowed to save the record. This will cause confusion later down the road since the picklist and the rouge text info entered won't relate to each other.

I tried modifying the rule to this and other variations, and the rule just let the record save when the picklist value was blank but included text into the text field.

AND( 
    ISBLANK( If_Yes_What_liens_are_field_against_you__c ), 
      ISPICKVAL( Any_other_liens_filed_against_you__c , "") 
)

I supposed I'll need to rewrite my original VR when No is selected from the picklist too?

What should the validation rule be modified to that will no allow a user to enter text into the text field unless the picklist value has been selected as Yes? and if a user selects No, the text field must contain a value.

1 Answer 1

3

I think you mean to say and if a user selects No, the text field must NOT contain a value.

OR(AND(ISPICKVAL( Any_other_liens_filed_against_you__c,"Yes"),ISBLANK( If_Yes_What_liens_are_field_against_you__c )),
    AND(ISPICKVAL( Any_other_liens_filed_against_you__c,"No"),NOT(ISBLANK( If_Yes_What_liens_are_field_against_you__c))),
    AND(ISPICKVAL( Any_other_liens_filed_against_you__c , ""),NOT(ISBLANK( If_Yes_What_liens_are_field_against_you__c )))
)

Its basically 3 conditions (with OR):

  1. Yes and ISBLANK(Text)

  2. No and Not ISBLANK(Text)

  3. "" and Not ISBLANK(Text)

4
  • This is correct but also if none of the picklist values are chosen, the text field should be left alone. However, you might get a user who will randomly enter junk info into an open text field. Would it also be possible to detour a user from saving the record if they are entering random info when the picklist has not been selected with a Yes or No? thanks!
    – rouqeOne
    Commented Aug 3, 2019 at 12:08
  • @rouqeOne the 3rd option - "" and Not ISBLANK(Text), should handle that situation. Pls let me know if it doesnt? Commented Aug 3, 2019 at 13:40
  • @rouqeOne, did this solve ? Commented Aug 4, 2019 at 14:59
  • that did the trick!
    – rouqeOne
    Commented Aug 7, 2019 at 4:05

You must log in to answer this question.

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