I'm fairly new to Salesforce and Apex. From the research I have done, I am under the impression that the solution I need is not an easily achievable one and I will have to create a VF page.

I would like to (upon creating a new case) select a case type from a picklist. Once the type has been selected, have the appropriate fields appear for that type (and only those fields). Each type of case will have a set of different fields. Also, once the case is saved, I would like to have a separate view for each type.

Is this achievable? Where do I begin with this?

1 Answer 1


The solution is actually fairly simple: record types.

Even though this actually depends on your business model and may not be suitable for yours depending on the specifications, I recommend you read about it to double check if the application of them serve your use case.

Instead of having a picklist as such, which is a field, you would create a record type, which is a different type of metadata. Then whenever the user is going to create a record he will be asked for the record type, even before having access to the layout to fill the fields in.

The main advantage of record types is that you can give each of them a different layout, so you can hide/display fields at will. This is later complemented with Salesforce visibility rules (profiles, etc.).

Even though I would generally recommend you to read some trailheads (which I still do), I found this article which is more specific in order to understand record types and page layouts. In this url there are some tips and tricks for using record types

Lastly, remember to take into account that this solution I'm proposing is condition by your business model and the use case, which is not shared in your question. If at any point you see it does not fit your need, you might have to implement a more complicated solution.

  • This is the exact answer I was looking for! Thank you for saving me from headache
    – evanesco
    Dec 21, 2017 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .