There are times when people have to pick something from a drop-down list and he has to keep scrolling to find the relevant values as per his interests and preferences. The reason is that almost everything is included in the list and it is too long to check out. So, the process is not only time consuming but it is stressful too. Here, the concept of field dependencies comes into play where you can refine your search from the drop-down list based on filters.
In this blog for how to create field dependencies in Salesforce, let us first discuss what are field dependencies, a variety of data types to define the field dependency, step by step guide to field dependency creation, How Field dependencies work in the Salesforce etc. Before we go into depth, let us start our discussion with Field dependencies first. Topics to be covered in the blog include –
Field dependencies are the special type of filters that help us to change the content of a picklist based on the value of another field. For example, instead of displaying the all possible options for a country in a single picklist, this is always great to limit the values to display based on the value of other fields like State. This is an excellent style to pick the right option quickly and more conveniently. Another example can be taken for the food items where deciding from the long list is usually time-consuming and boring, you can limit the search by keywords like breakfast, lunch, dinner etc. The values for picklist could be defined as controlling fields and dependent fields as shown below:
With these important points, you must have a clear idea of controlling fields and the dependent fields and how should you define them.
First of all, Login to your Salesforce account to create the field dependencies. We are taking the example of healthcare product here and how to create the dependencies for the same.
Further, this is necessary to define which type of values you wanted to save in controlling fields and dependent field, it can be anything from a number to the alphabet or formulas etc. In the next section, we will discuss the complete list of data types for field dependencies and how they can be used to make the concept little more relevant and useful for the users.
|Auto-number||This is a sequence number that is system dependent and using a display format. If you are planning to use this data type then the number will automatically increase by one for the next new record added.|
|Formula||This is a read-only field that is taking its value from the formula expression. The value of the formula field will change automatically as soon as the value of the source field will be changed. With the help of a formula field, you can define the custom summaries based on reported data and the calculated values. Further, these formulas can also be used as the columns in the report.|
|Look relationship||This field created the relationship with the help of which one object can be connected with the other. With the help of this relationship, you can always choose the lookup icon to select values from the pop-up list. The second object will be the source of value in the list.|
|Roll-up Summary||This is again a read-only field that helps you to display the values like sums of numbers, maximum value from the list, minimum values from the list, total count for all records and much more.|
|Master-Details Relationship||As the name suggests, this relationship will define the master-slave relationship between objects or we can say parent-child relationship too. This is necessary to define the relationship field for almost all detail records. Once you have defined the relationship field and it has been saved then you cannot change it. The ownership for the field is further defined by the master record. If a user deleted the master record then detail record will be deleted automatically.|
The roll-up summary fields can also be defined for the master record to summarize the detail record.
|Checkbox||With this field, you can always select the true or false values for the objects. The checkbox values can be defined as controlling fields, not the dependent fields.|
|Currency||With the help of a currency field, you could enter the amount in different currencies like Dollars, Indian rupees or more. This is also useful in exporting data to the excel file or other spread sheets.|
|Date||With the help of this field, you can always enter the data or pick the date from the popup calendar.|
|Date / Time||Next popular data type is Date/time field where you can pick both either date or time from the popup calendar. The choice is up to you or it also depends on project requirements either you wanted to use the date field only or you wanted to add date/time both.|
|This field will allow users to enter an email address and validate the data in the proper format. If the field is defined as lead or contact, the address will be picked up automatically based on records. Keep in mind that custom email address cannot be used for mass emails.|
|Percent||What to do if you wanted to add a percent number? With the help of percent data type, the sign of percentage will be automatically added to the number but make sure that fields are marked as percent during declaration.|
|Phone||Give flexibility to users so that they could add phone number automatically in the proper format either mobile number or the landline.|
|Number||With this data type, you can add any type of number but the leading zeros are removed later when you store the values.|
|Picklist||With the help of this data type, one value can be picked from a long list defined by the user. In a few cases, there is freedom to select multiple values too, if the multi-select option for the picklist is validated.|
|Text||As the name suggests, it will allow users to add letters, numbers or the combination of letters or numbers too. It is common in the case of user id or passwords.|
|Text areas||With this data type, you can limit the count of characters that can be entered by the user in the given space. In most cases, it is 255 characters only. You can define the long text areas too where users are allowed to enter up to 32,768 characters or more. With the rich text area option, users are allowed to enter formatted text, images or links etc. next is encrypted Text area where values are added in the form of text or numbers and it is stored in the encrypted format.|
|URL||with this data type, users are allowed to add any valid email address. As soon as users click on the link, it will open in a separate browser.|
With this discussion, you have a complete information of Field dependencies, how to create Field dependency in Salesforce and different data types for field dependencies etc. Once you will go through each of the sections carefully, you can quickly start using them practically and don’t forget to validate the values ahead. I hope you enjoyed reading the blog and learned something new with this blog post. Don’t forget to share your experience with us!
A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.
Receive Latest Materials and Offers on Salesforce Course