There can be scenarios where you want to accept data in different ways around the same object. For instance: You may have a Case Object with two variations Internal and External. The might gather different data and would need different picklist values. Record types in Salesforce are the best approach for this.
What are record types in Salesforce?
- Record types in Salesforce are incredible tools that manage the organized data about an object.
- Record types control page layouts and picklist values of an object which will be visible to different users while creating a record of that object.
- An administrator can assign different record types to users based on the profile and whenever users of certain profiles will try to create a record of that object they will see different picklist values based on the profile or based on the record type which they are assigned.
- They will also see different page layouts.
Record types in Salesforce control 3 things:
- Business processes
- Page layouts
- Picklist values.
1. Business Processes are special picklist fields that capture the life cycles of opportunities, cases, solutions, and Leads or other objects. Provides ways to track separate sales, support, and lead lifecycles across different divisions, groups, or markets.
Different Business Processes:
- Sales Processes – contains some or all of the picklist values available for the Opportunity Stage field
- Support Processes – has some or all of the picklist values available for the Case Status field
- Lead Processes – include some or all of the picklist values available for the Lead Status field
- Solution Processes – include some or all of the picklist values available for the Solution Status field
2. Page Layouts let you select and organize a group of fields related to an object.
3. Picklist values are the list of choices that you define when you create a picklist field. You can also define a master list with all possible choices and use record types in Salesforce to display a subset depending on the situation.
How to create record Types in Salesforce:
- Let us create a record type for Case object :
- Setup->Customize->Case->Record Type
- Click on the New button and fill all mandatory fields and select profiles.
- Create a support process prior to creating record type
- Click on Next button
- Select page layout and click Save.
- Page Layout Assignment
- Click on Page layout Assignment from the page layout or record type
- assign page layout to corresponding record types based on the profiles.
Example of Record Type Scenarios:
- Requirement: There are students from Computer Science, Electronics, Mechanical, Civil Background. Each student needs to enter the marks they have got in the test for each subject of their department.
Note: here in this scenario were are not worried about validation and authenticity of the data being entered, we just need to see how we can achieve this on the single object Student with the help of record types in Salesforce.
- You will need to create the Object Student and all the required fields like department, professor, Subjects, marks and student details like Name and Roll.
- (In this example we are using single page Layout) You will then create record types for Computer Science, Electronics, Mechanical, and Civil.
- Once the record Type has been created you will assign the correct subject corresponding to each department.
- Create the object Student.
- Create Field (Picklist) Subject and enter all values from all departments.
- Create other fields like Name, Roll, etc.
2. Enter all the values in the field Subject:
3. Create the record type and select the profile with which you want to share the record type. Once the record type is created you will see all the picklist Fields present in the object like this :
4. For Picklist Field Department you can select the Department name and make it default.
5. For Picklist Field Subject, you can select all the subjects which belong to the particular department. For instance,
6. Similarly, do this for all other departments and you are done. Now try to create record :
7. The fields will be the same for all the record types as we are using the same page layout for all record types.
8. Picklist values of the Fields will be different as we have selected different picklist values for each record type.
You can see here you are seeing only subjects which belong to the Computer Science department.
In the above example, we used the same page layout because we just needed different picklist values for all the record types, all the fields were the same for each record type.
Let us see another requirement and I want you guys to work on it and share the details of your approach with me in the comment box. You can also mail me at firstname.lastname@example.org
Assignment: RTBank is one of the leading banks in your country. Employees of this bank can open Savings account of all categories which is Savings Minor, Savings General, and Savings Senior. Only the Manager can create Current Accounts. Fields like Limits of the account are mandatory for Employees but not for the Manager.
Now let us understand the Business Processes in detail.
Record Type for Business Processes
As we discussed above, Business Processes are the special Picklist that captures the life cycles of opportunities, cases, solutions, and Leads. Let us understand this with a simple example:
A Case always goes through certain support steps:
- Case Accepted
- Case Assigned
- Case In Progress
- Case Closed
A Support process is simply a set of steps that are defined in your org based on the requirement by the business. For Instance,
- Case Accepted
- Case Proposed
- Case Prioritized
- Case Closed
For Sales Processes, we can take the below example:
Sales Processes #1:
- Demo Scheduled
- Negotiate Contract
- Closed Won
Sales Process #2:
- Initial Pitch
- Advanced Pitch
- In Trial
- Closed Won
To understand Business processes in detail I would highly recommend you to see this video from Salesforce
Record Type Limitations
Make Sure you know these limitations when working with record types and business process picklists.
- Below Mentioned picklist fields are not present for record types as they are used exclusively for Sales, Lead, Support and Solution Processes.
- Opportunity Stage
- Case Status
- Solution Status
- Lead Status
- You cannot modify or delete a record type if the object is referenced in Apex.
- You cannot also deactivate a record type if the record type is in use by any email routing address for Email-to-Case or On-Demand Email-to-Case.
- You can assign Record types to campaign members using the Campaign Member Type field on new or existing campaigns.
- Salesforce recommends to not create more than 200 record types. There is no limit, however, orgs might face difficulty in managing the record types if they exceed 200.
If you are preparing for Salesforce interview then you must check out: Salesforce Interview Questions you must not miss in 2020