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
Laxmaya ChnLaxmaya Chn 

How to disable a picklist field upon clicking(checking) a check box

Hi 
I have a picklist field that should disable upon checking check box, can any one help me here. Thanks in advance.
Best Answer chosen by Laxmaya Chn
shashi lad 4shashi lad 4
AND(ISBLANK(TEXT(pick__c)), check__c)

All Answers

William TranWilliam Tran

You can't do this using out of the box functionality.

You can hide/disable a picklist based on a checkbox using Visualforce.

Thx

shashi lad 4shashi lad 4
With standard page layout it is not possible. However, Visualforce is the only option.
One more thing you can do is , setup validation on the field. If checkbox is ON and user picks value in picklist, it will raise the error. I hope this helps.
Thanks

- shashi
Laxmaya ChnLaxmaya Chn
Can you please state that validation rule? Thanks
William TranWilliam Tran
No, validation only stop you from saving a record if a condition is not met.

That said, you can create a validation rule to stop the user from saving if a value is chosen from the picklist when a checkbox is checked

Validation rule would look something like this: 
IF(
AND(checkbox__c, Text(Picklist__c) <>''))

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you. 

Thanks
 
shashi lad 4shashi lad 4
AND(ISBLANK(TEXT(pick__c)), check__c)
This was selected as the best answer