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
Aaron WoosterAaron Wooster 

How to make fields appear/disappear based on value in a picklist field?

I am trying to create functionality to make fields appear/dissapear based on which value is selected in a picklist field. I have an object in my salseforce called POLICIES (we are in the insurance business) and have a number of custom fields within that object. Instead of seeing all of the fields when I create a policy, I'd like to only see the fields that are relevent to the type of policy I am entering. For example, I have fields that are specifically related to HOME policies and fields specifically there for AUTO polcies. When I click on the dropdown in my piclist field for POLICY TYPE, I'd like only the fields that are related to an AUTO polict to appear. I contacted salesforce premier and was told that I could accomplish this in part with field dependencies. I am already utilizing this feature but it only greys out the fields that aren't relevent, it doesn't make them dissapear all together whchi is what I am after. I was told this was not an out of the box functinoality and to come to the visualforce/developer page for help so here I am. Any help would be appreciated, thank you!
Neetu_BansalNeetu_Bansal
Hi Aaron,

As you can hide or display fields on the basis of picklist selection. To achieve this either you can create a custom visualforce page or you can create Record type for Policy object like Home, Auto, etc. and then create different page layouts for the record type, where you can specify which fields need to be display.

If you need any further help, you can contact me either on my gmail id: neetu.bansal.5@gmail.com or skype id: neetu.bansal.5.

Let me know if you need any other help.

Thanks,
Neetu
Aaron WoosterAaron Wooster
Neetu,

I think I would prefer the Record Type solution however I am running Professional Edition and I believe to use Record Types you need at least Enterprise. I have never created a custom visualforce page before. Are the visualforce pages relatively simple to use or would it require the employ of a programmer?
Neetu_BansalNeetu_Bansal
Hi Aaron,

Yes in professional edition, record types are not available and also you can't create apex classes in professional edition. But we can achive your requirement with only using visualforce pages.

You can create visualforce pages but if its your first time, you may need a programmer. You can contact me on any of my personal ids to do this for you.

Let me know if you need any other help.

Thanks,
Neetu