0

I have 3 fields on Account Object.First field is checkbox,second field is Lookup fields and third field is Picklist. While creating an account if I dont provides any input to any of those fields,it should allow me to save the record but if I provide any one of the field value then it should display validation message also if I field any 2 of those fields value,then validation message should display. Account will allow to save only when: 1.All 3 fields are blank.. 2.All 3 fields must have value.

I am trying to written a validation rule like this:

OR(
AND(Key_Account__c = True, AND(ISPICKVAL(Status__c, ""), ISNULL(Manager__c))),
AND(NOT(ISPICKVAL(Status__c, "")),AND(Key_Account__c = false,ISNULL(Manager__c))),
AND(!ISNULL(Manager__c),AND(Key_Account__c = false,NOT(ISPICKVAL(Status__c, "")))),
)

but it does not work when I provide all 3 values here. Can someone help what I am missing here?

1 Answer 1

0

Try this

OR(
    AND(
         Key_Account__c = False, 
         ISBLANK(TEXT(Status__c)), 
         ISBLANK(Manager__c)
    ),
    AND(
         Key_Account__c = True, 
         NOT(ISBLANK(TEXT(Status__c))), 
         NOT(ISBLANK(Manager__c))
    )
)
1
  • 1
    Yes..I have found that ISNULL is not working for lookkupfield.So i have used ISBLANK for both Lookup as well as Picklist field..Thanks
    – SFDCDJ
    Dec 30, 2016 at 12:31

You must log in to answer this question.

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