+ Start a Discussion
SandrineSandrine 

Validation rule to uncheck the check box based on Picklist value

Hello,

I have picklist_custom__c with values ABX, CDE, PQF
And a chekbox_custom__c

I want to implment a validation rule where
If(picklist_custom__c  == ABX or  PQF)
then the chekbox_custom__c is unchecked

tthank you for suggestion
Best Answer chosen by Sandrine
Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Validation Rules require you to write the error condition always. You need to throw an error when the checkbox is checked (based on picklist value).
AND( 
    OR(
       ISPICKVAL(Picklist_Custom__c, "ABX"), 
       ISPICKVAL(Picklist_Custom__c, "PQF")
    ), 
    Chekbox_Custom__c = TRUE
)

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi,

Greetings to you!

Validation Rules require you to write the error condition always. You need to throw an error when the checkbox is checked (based on picklist value).
AND( 
    OR(
       ISPICKVAL(Picklist_Custom__c, "ABX"), 
       ISPICKVAL(Picklist_Custom__c, "PQF")
    ), 
    Chekbox_Custom__c = TRUE
)

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Ajay K DubediAjay K Dubedi
Hi Sandrine,

Please use the validation rule below for your requirements.
Validation rule will throw an error -
If(picklist_custom__c  == ABX or  PQF)
and the chekbox_custom__c is checked

RULE-

IF( AND(OR(
       ISPICKVAL(Picklist_Custom__c, "ABX"), 
       ISPICKVAL(Picklist_Custom__c, "PQF")
    ), 
    Chekbox_Custom__c = true ), true,false)


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com  (http://www.ajaydubedi.com )