Record Types in Salesforce
Record types control the page layout and the picklist values that should be available for the user while he/she is entering the record. Let’s give a brief introduction to page layout first. Page layout is how we customize the page by organizing different fields, sections, related lists on an object detail or edit page.
Record types make use of these page layouts, allowing different users with different profiles to insert records in a different page layout. For example, Suppose we are running a recruitment drive and are in a need of freshers as well as experienced candidates, obviously the ones with experience will have some past working experience so an additional section of last job details would be there and a picklist that will have different options for a fresher and different options for an experienced candidate. This segregation would be based on two different candidate profiles, firstly a fresher and secondly an experienced candidate.
Purpose of record types:-
i) Dividing an object into multiple types so that different types of information can be stored in a single object. For example there are fresher and experienced students, but they are students.
ii) Allows you to customize the various features of both standard and custom objects based on profile. For example multiple divisions of a sample company based on functionality.
Creating a new record type and demonstrating its use:-
These are the available Page Layouts for the Account object
By clicking on Fields & Relationships, we are going to add fields into our object, one such field is a picklist which allows us to pick a value from a list.
Here we are going to create a picklist called Designation, which will have a designations for both Sales employees and Marketing employees but we will be able to separate it in our record type.
Click on the Record Type, we can see that there are no Record Types for this object at present.
By Clicking on new we create a new Record Type called “Sales_Employee_Ac” which will display a particular page layout for it.
In this step, we chose which particular page layout we want for this Record type
Here record type allows us to edit our existing picklist and filter out those items which are not needed for that particular page layout, here we will only keep designations related to Sales.
Now creating the Record Type for the Marketing employee
Choosing the particular page layout for this Record Type
Similarly choosing the items from picklist that are related to a marketing employee.
Our Record Types are ready
Now that our Record Types are made , we will go to the Accounts object and try to add a new record.
We see before making a record it is asking us to select which record type we would like to go with, this is the use of a record type. It allows us to have this kind of choice before accessing a particular page layout associated with a record type.