0

I have 6 fields, 3 of which are picklist and 3 of which are text fields. If any of these fields are not null or blank, I want make another filed mandatory.

I tried a validation rule with or condition.It didn't work.please suggest any solution

OR(NOT(ISBLANK(unit__c)),NOT(ISBLANK( Activation__c )),NOT(ISBLANK(  
   Device__c )),NOT(ISPICKVAL(Unit_Price__c,"") ),NOT(ISBLANK(Fss_Reasons__c )))
1
  • Hey sorry i forgot to close the answer.Once again thanks for sharing knowledge.@Adrian Larson
    – Pavan tej
    Jun 21, 2016 at 20:11

1 Answer 1

4

You need to check that the field you want to be "required" is actually blank in the instance that any of those fields are populated.

AND(
    ISBLANK(MandatoryField__c), // MISSING
    NOT(AND(
        ISBLANK(Text1__c), ISBLANK(Text2__c), ISBLANK(Text3__c),
        ISPICKVAL(Picklist1__c, ""), ISPICKVAL(Picklist2__c, "")
    ))
)
6
  • But what happens.When i try to create any opportunity with out any details of the above field.It throws an error @Adrian Larson .Means i don't want a field to be mandatory if all fields are blank
    – Pavan tej
    Jun 21, 2016 at 18:16
  • Wait, what? It should be mandatory if any are blank, except if they all are blank?
    – Adrian Larson
    Jun 21, 2016 at 18:18
  • I need that field to be mandatory.If any field have value. @Adrian Larson
    – Pavan tej
    Jun 21, 2016 at 18:20
  • Okay...you could make your OP more clear...
    – Adrian Larson
    Jun 21, 2016 at 18:27
  • 2
    I edited formula a bit to make it cleaner: AND( ISBLANK(MandatoryField__c), // MISSING NOT( AND( ISBLANK(Text1__c), ISBLANK(Text2__c), ISBLANK(Text3__c), ISPICKVAL(Picklist1__c, ""), ISPICKVAL(Picklist2__c, "") ) ) )
    – o-lexi
    Jun 21, 2016 at 18:46

You must log in to answer this question.

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