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

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) 
) 
)
| improve this answer | |
  • Thank you so much. This worked :) – user70279 Jun 28 '19 at 14:08

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.