Field Dependencies in Salesforce – Salesforce Tutorials

In this Salesforce tutorial we are going to learn about Field Dependencies in Salesforce, Field Dependent picklist in Salesforce. Let us learn about Field Dependencies in Salesforce.

What is Field Dependencies in Salesforce?

Field Dependencies in Salesforce are the filters that allow user to change the contents of a picklist based on the value of another field.

Example :- Here there are two field called Country and State. We have to display all states that are related to Country Field. Like wise Districts that are related to States. Here one field is dependent on another field.

In Field Dependencies, we have to learn about two fields they are

  1. Controlling Field.
  2. Dependent field.

Controlling Field :- A controlling field is that which controls the available values in one or more corresponding dependent field.

Dependent Field :- A dependent field displays values based on the value selected.

  • Custom picklists can be both Controlling and dependent field.
  • Standard picklists field can only be used for controlling.
  • Default values can be set for controlling field.
  • We can not set default values for dependent picklist.
  • Multi Select picklists can be dependent.
  • Controlling field must be added to page layouts.
  • In controlling field we can add up to 300 values.

How to create Field Dependencies in Salesforce?

Login Salesforce to create Field Dependencies in Salesforce for pharma product. Go to Setup | Build | Create | Objects | Pharma Product | Custom Field and relationships | Field Dependency.

Field Dependencies in Salesforce - Salesforce Tutorials

  • Click on Field Dependencies as shown above.

Field Dependencies in Salesforce - Salesforce Tutorials

As there are no Field dependencies in the object click on New button.

Field Dependencies in Salesforce - Salesforce Tutorials

Now select controlling field and Dependent field. Here we have selected controlling field as Category and dependent field as Sub Category.Field Dependencies in Salesforce

To includes values double click on the values. We have selected for category Small, Medium and Large. Finally click on Save button. 

How Field Dependencies in Salesforce works.

To check the working of Field Dependencies in Salesforce go to Pharma product object and click on New. Now when creating a record category and sub category field are present.

Field Dependencies in Salesforce

When we select large as controlling field, In dependent field large1, Large2, Large3 sub category items will be displayed as drop down.