1

I've been trying to figure this out and cannot get it to work. I've tried the following combinations and nothing I do gets it to trigger.

We have a lookup field that looks up to the Sales Order object, and relates it back to a specific quote. The purpose of the validation rule is that if the fields denoted below are blank, a Sales Order CANNOT be populated/related.

 IF(ISCHANGED(PBSI__Sales_Order__c), 

 AND( 
 ISBLANK(Panels__c), 
 ISBLANK(Contract_System_Size_Watts__c), 
 ISBLANK(Usage_Offset__c) 
 ), 

 false)

Number 2 attempt:

 IF(!ISBLANK(PBSI__Sales_Order__c), 

 AND( 
 ISBLANK(Panels__c), 
 ISBLANK(Contract_System_Size_Watts__c), 
 ISBLANK(Usage_Offset__c) 
 ), 

 false)

Number 3 attempt:

 AND( 
 !ISBLANK(PBSI__Sales_Order__c),
 ISBLANK(Panels__c), 
 ISBLANK(Contract_System_Size_Watts__c), 
 ISBLANK(Usage_Offset__c) 
 )

Attempt 4:

AND( 
ISCHANGED(PBSI__Sales_Order__c),
ISBLANK(Panels__c), 
ISBLANK(Contract_System_Size_Watts__c), 
ISBLANK(Usage_Offset__c) 
)

I'm certain it's logical in nature. I'm not sure I'm looking at validation rules properly in my head. If someone could show how it is supposed to look to work, and then break it down explaining why it works, I would appreciate it.

Thanks!

6
  • Is changed doesn't fire on new records. That might help w some of the scenarios. Also, the ANDs mean that all of the fields have to be blank to be true. One way to test these is to create new checkbox formula fields on the object so you can see how it evaluates. Will look at this in detail when I get a chance if nobody else gets you the answer by then.
    – gorav
    Commented Jul 1, 2016 at 22:24
  • Attempt 3 looks legit for me. Do you want this to trigger only when all 3 fields are blank and PBSI__Sales_Order__c is populated?
    – o-lexi
    Commented Jul 1, 2016 at 22:26
  • 1
    Did you try swapping ISNULL in for ISBLANK?
    – Adrian Larson
    Commented Jul 1, 2016 at 23:20
  • @Oleksiy It's to prevent PBSI__Sales_Order__c from being populated if the other fields haven't had information entered into them yet.
    – Genko
    Commented Jul 5, 2016 at 17:09
  • @gorav This particular one should only need to trigger during updates. New records of this object shouldn't need to have this fire for it. I'll try your checkbox method as I continue to play with this. At the moment I haven't gotten it working yet.
    – Genko
    Commented Jul 5, 2016 at 17:11

2 Answers 2

2

Try that:

 AND( 
 NOT(ISBLANK(PBSI__Sales_Order__c)),
 OR(
 ISBLANK(Panels__c), 
 ISBLANK(Contract_System_Size_Watts__c), 
 ISBLANK(Usage_Offset__c))
 )
1
  • This worked! Thanks! I'm comparing it to my own code and am trying to break down the logic for how it works, so I can better understand what I am doing next time.
    – Genko
    Commented Jul 5, 2016 at 17:13
0

Set validation rule condition as only

AND( ISBLANK(Panels__c), ISBLANK(Contract_System_Size_Watts__c), ISBLANK(Usage_Offset__c) )

You must log in to answer this question.

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