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
Sfdc@SmithaSfdc@Smitha 

Can we use check box in dependent picklist?

Hi

 

Interview question:Can we use the check box in dependent picklists?Can anybody help me?

Best Answer chosen by Admin (Salesforce Developers) 
SabrentSabrent

Yes you can use Checkbox with a dependent picklist however Checkbox fields can be controlling fields but not dependent fields.

 

you can try this  -

 

On an Object , Create a Checkbox field D1__c , Create a Picklist field D2__c ,

Under the Custom fields and Relationship Section Click the 'Field Dependencies' button, Click New

In the controlling Field choose D1 and in Dependent field Choose D2

 

The page that opens next is very self explanatory. follow the instructions and you'll learn that Checkbox can be used in a dependent picklist.

 

 

 

All Answers

AmitSahuAmitSahu
I think it's a NO....If anyone knows please share a sample code :) will help other at some points for sure...
SabrentSabrent

Yes you can use Checkbox with a dependent picklist however Checkbox fields can be controlling fields but not dependent fields.

 

you can try this  -

 

On an Object , Create a Checkbox field D1__c , Create a Picklist field D2__c ,

Under the Custom fields and Relationship Section Click the 'Field Dependencies' button, Click New

In the controlling Field choose D1 and in Dependent field Choose D2

 

The page that opens next is very self explanatory. follow the instructions and you'll learn that Checkbox can be used in a dependent picklist.

 

 

 

This was selected as the best answer
AmitSahuAmitSahu
Sorry :) may bad... I should have read it once more... I thought you want a check box as a picklist value... :) thanks Rov ....
Mani Kantha MallajosyulaMani Kantha Mallajosyula
Yes we can use pick list as controller for check box,we can't disable a check box but we can show an error message by using this code 
IF( TEXT( course)  <>  "ABCD" ,   checkbox1 ,   checkbox 2  ).

Explanation:

We can't use picklist directly we can use a function called TEXT for converting the picklist and accesing the picklist.

Here
1 IF is function .
2.TEXT is a function for accesing picklist values.
3."course"  is a picklist.
4. <>  not equal
5."ABCD" is one value in picklist(i want ABCD for online and other for classroom)
(I have a pick list contains three values "ABCD","EFG","HIJ" and i want "ABCD" only for online and others for classroom here online and classrom are checkboxes)
6.Check box 1 (online).
7.Checkbox 2(classroom)