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
xsamxsam 

pick list or check box ???

# Are you salesforce smart?

pick list 

yes 

no 

 

or checkbox 

 

Please explain why?

Advanz Knowledge SystemsAdvanz Knowledge Systems

Hi,

 

Picklist is not only for yes or no. we can give another values in place of that values but when we select checkbox it default says true or false.

xsamxsam

That is correct. In this scenario my picklist are yes and no. My question is what data type should we use in this scenario and why? should we use picklist or checkbox?

Marko LamotMarko Lamot

It really doesn't matter from the data-type point of view. You can always convert betwen data types...

I would rather think from the user-interface point of view - what fits better in your business logic.

 

For example, for user is more transparent if he has something to decide between yes/no. I would put in that case picklist.  On the other hand, if there is more like of an option to say yes or no, I would probbabily use checkbox.

 

You may also consider what is nicer on the reports; Sometimes Yes/No picklist field gives clearer meaning of the value in the reports...

 

 

 

xsamxsam

 Thank you,

I am more concerned about  what record type should i use? how will it effect while using formula or validation rules or may be creating custom reports? 

MellowRenMellowRen

xsam

 

In most cases it won't matter. With validation rules or formulas (or Apex code), anything you can do with a picklist you can duplicate with a checkbox and vice versa.

 

The only case it may matter is that in formulas (including validation rules) there is a character limit (quite large: 5000). Generally formulas with checkboxes will use up less characters so if you are likely to write formulas that would be that long go for checkboxes.

 

In practice though, I agree with MarkoLamot—go with the type that makes the better UI or report format.

 

Regards

MellowRen

Shannon HaleShannon Hale

From a user experience perspective, the primary reason you would use a picklist (or radio buttons, in other UIs) when it's a binary would be when the consequences for checked versus unchecked choices would be ambiguous. For example, if it's an option for enabling something and it's not clear what will happen if you don't enable it.

 

For the case of a simple yes/no, a checkbox is usually fine, and it's a little easier to deal with in formulas referencing the checkbox since you can just use IF(MyField__c, true case, false case) as opposed to IF( ISPICKVAL(MyField__c, "Yes"), true case, false case).  But if you think you might add other options in future, you might want to go with the picklist.

xsamxsam

shale, 

 

That was a great help. I will keep that in mind. Thank you.

SachinSankadSachinSankad

Hi,

 

In this scenario, I think you should use checkbox as your answer will be either yes or no.

Similarly, checkbox datatype is similar to boolean i.e. it should return true or false.

If you need to get the multiple answers in this scenario then you need to use multi-select or simple picklists.

Thanks,

Sachin.

Jack VolkovJack Volkov
If the options are only ever going to be YES or NO for reporting and referencing the field in formulas a boolean value is going to be better.

Create 2 new lead fields; a Picklist field named Picklist__c with the options of Yes and No, then a Boolean feild named Boolean__c.

Now create a report grouped by lead owner.  
Add the count to each summary line when Boolean__c=True.  Cool.  
Now do the same only this time where Picklist__c = Yes.  Can't do it.  Now you're forced to do more customization.

Create a validation rule where Picklist__c = Yes.
ISPICKVAL(Picklist__c,"Yes")

Now create a validatin rule Boolean__c = True.
Boolean__c

As you can see working with Booleans is much easier than Yes/No picklist for report builders, admins, and developers.