How can I hide/unhide fields based on a checkbox? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Lynnetta ZolmanLynnetta Zolman 

How can I hide/unhide fields based on a checkbox?

I am currently using Account field dependencies to lock out fields that a sales person will use or not use based on a checkbox. I would like to hide those fields to clean up the interface and make it easier to use. If that is not possible a drop down that would display selected fields would work also.

Perferred method Example 1: 
This customer needs a fire alarm product but not a card access product.

Fire alarm = true

Displays
Fire alarm Manufacturer
Fire alarm product
Installation date
Notes

Card access = false

Hide
Card access Manufacturer
Card access product
Installation date
Notes

Alternate Example 2:
We have a drop down that just has all the types of businesses we service and we can assume what fields a sales person will need.

Drop down = Small business
 
Display
All Fire alarm fields
All CCTV fields

Hide
Card Access fields
VoIP fields
Clock Sync fields


Best Answer chosen by Moderator (salesforce.com) 
Aaron DeRanAaron DeRan
Salesforce doesnt support this. You can create field dependencies but all fields always show up on the page at all times for users as long as the field is included on the page layout and the field level security gives them access to it.

Promote this!!! - http://success.salesforce.com/ideaView?id=08730000000Brox

All Answers

Pierre Despatis-DupontPierre Despatis-Dupont
Short answer is no. 

You can't hide fields depending on values in other fields. Most user will set up a validation rule (VR) instead. For example, if "Card access" is false, then "Card access product" must be blank. 

There are workarounds. You could code a custom visualforce page, or use record types/page layouts if you edition has those. What is your edition? Both of these options have a lot of overhead so it most cases a VR is preferred. 
Aaron DeRanAaron DeRan
Salesforce doesnt support this. You can create field dependencies but all fields always show up on the page at all times for users as long as the field is included on the page layout and the field level security gives them access to it.

Promote this!!! - http://success.salesforce.com/ideaView?id=08730000000Brox
This was selected as the best answer