Dependant Picklists are those the values of which depend on the chosen value of another field.
Lemme tell you with a simple example.
Let's say there are 2 Picklist fields -- Country and States. You might of come across such scenarios where if you choose a value , let's say India in the Country field and then move to the State field to choose the State, you would only see the states that belong to the chosen value- India . So you would not find states in the State field that belong to any other country .
Here the value of the State field is dependent on the Country field. Here State field is called the Dependent field.
How to create dependent picklist in salesforce
Let's do it here :
At first create 2 custom Picklist fields , following the summarized steps here : Setup |[ Customize | Create ] | choose the object where you would want to create the Picklist | New | and then follow the steps to create the picklist.
Now, after creating Country and the State Picklists, just go back to the Custom Object Definition Detail page and then click on Field Dependencies, that would be there in the Custom Fields and Relationships section .
Custom Fields & Relationships |
Then click on New to create a new field dependency
Choose the Controlling and then Dependent Fields
The Controlling Field should be Country and the Dependent Field should be the State. This ensures that the values of the State Field are dependent on the Country Field.
Then click on Continue
Here mark the appropriate States to their respective countries by selecting the values in the respective boxes and then clicking on Include Values.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Click on Save to save the changes.
We have now created a field dependency between 2 Picklist fields - Country and State.
Now go back to the object where you have created the picklist and check if you are able to see Albama in the State Picklist when you have chosen India in the Country picklist.
Dependent Fields
| Country | |
| State | ![]() |
Go to
testing
ReplyDelete