0

Field 1 is Multi picklist field and Field 2 is a text field. Trying to create a validation rule if Field 1 is not blank and Field 2 is blank, an error message should appear. Similarly when Field 2 is not blank and Field 1 is blank, an error message should come up.

Tried creating this rule which is Active but doesn't work. When I try to Edit-Save record, it shows error message even though both fields are blank.

OR( 
AND( 
NOT(ISNULL (Field1__c)), 
ISNULL(Field2__c) 
), 
AND( 
NOT(ISNULL(Field2__c)), 
ISNULL(Field1__c) 
) 
)

Thanks

1 Answer 1

4

as per doc, ISBLANK supports for multi picklist fields. and

Text fields are never null, so using ISNULL() with a text field always returns false. For example, the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in the New field. For text fields, use the ISBLANK function instead.

OR( 
AND( 
NOT(ISBLANK(Multi_Picklist__c)), 
ISBLANK(Field2__c) 
), 
AND( 
NOT(ISBLANK(Field2__c)), 
ISBLANK(Multi_Picklist__c) 
) 
)
1
  • Thank you so much. This worked :)
    – user70279
    Commented Jun 28, 2019 at 14:08

You must log in to answer this question.

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