function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DumasRoxDumasRox 

Help with picklist / checkbox validation rule ~ Easy

Hello,

 

I am trying to create a validation rule and I have not done very many. Please help.

 

IF Text_Field_A__c is not blank, THEN Picklist_Field_B__c OR Checkbox_Field_C__c can not be blank.

 

I am having trouble figuring out how to encompass the OR statement.

 

Is this even close?

 


And(
 Text_Field_A__c ,
NOT ISNULL (ISPICKVAL(Picklist_Field_B__c, "") ,
OR NOT ISNULL (Checkbox_Field_C__c)
)

 

Thank You!

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You STILL owe me a beer ;-p

 

AND(NOT(ISBLANK( Text_1__c )), 
OR( 
ISPICKVAL(Picklist_1__c, ""), 
NOT(Checkbox_1__c )))

 

 

All Answers

Steve :-/Steve :-/

Here you go

 

AND(NOT(ISBLANK( Text_1__c )),
OR(
ISPICKVAL(Picklist_1__c, ""),
ISPICKVAL(Picklist_2__c, "")))

 

PS.  You owe me a beer (these terms are non-negotiable)

 

PPS.  I like to drink these ->

DumasRoxDumasRox

Thanks for helping me on this Stevemo.

 

One Change:

The third value in my example should be a checkbox, not a picklist...?

 

AND(NOT(ISBLANK( Text_1__c )),
OR(
ISPICKVAL(Picklist_1__c, ""),
ISPICKVAL(Picklist_2__c, "")))

 

Steve :-/Steve :-/

You STILL owe me a beer ;-p

 

AND(NOT(ISBLANK( Text_1__c )), 
OR( 
ISPICKVAL(Picklist_1__c, ""), 
NOT(Checkbox_1__c )))

 

 

This was selected as the best answer
Steve :-/Steve :-/

but since my first Answer was incorrect I'll give you a discount... 

http://beeradvocate.com/beer/profile/220/1372

DumasRoxDumasRox

That will work. Thanks again for your help. Go ahead and order a beer and add it to my tab. :smileywink:

Steve :-/Steve :-/

Well if you're going to be at Dreamforce '11 you're buying! ;-p

Preet KaurPreet Kaur
Picklist / Checkbox Validation Rule

Hi, following on from the above post, I'm in a similar situation. Im new to salesforce and would appreciate any help! I've not done very many validation rules either. 

If the 'Break Penalty inc. VAT' checkbox is checked and the 'Break Penalty Paid' picklist value is "Yes" an amount must be entered in the 'Break Penalty' field. Allowing the record to save. The formula should also work when the checkbox is checked and an amount is entered in the 'Break Penalty' field, the rule should fire telling the user to state whether the penalty has been paid in the 'Break Penalty Paid' picklist field. ('Yes' or 'No') 

The current formula I have is:

AND( ISPICKVAL( Break_Penalty_Paid__c , 'Yes')|| Break_Penalty_inc_VAT__c = TRUE && ISBLANK( Break_Penalty__c ) )

I am trying to save the record but I'm getting an error message..below..

User-added image

Any Help is Appreciated!! Thanks