Before we talk about what are record types in Salesforce, Let’s talk about what is the business use case where we will be needing the various record types.
Business Use Case: You are working as Salesforce Admin for Xcorp Ltd. Users who are part of the Sales department want to see the different set of fields on the record detail page & Users in the Marketing department wants to see different fields on the detail page for Lead Object.
Note: – Both department users want to see the different picklist values.
Whenever we need to display the different fields on the record detail page or need to display the different picklist values for the same picklist fields to different processes then we always go with Record Types in Salesforce.
What is Record Type
Record Type is a special type of object which can be related to almost any standard or custom object.
When you create a record type for any object then a new field becomes available and the API name is RecordTypeId.
Problem Statement
Your company is dealing with two types of accounts
USA Customers
International Customers
And for USA customers the Sales users only want to see the below values for the picklist
Education
Technology
Communications
Consulting
Finance
And for International Customers, want to see the below values for the Industry picklist
Government
Manufacturing
Media
Not For Profit
Create Record Types in Salesforce
As described in the problem statement, the end users want to see different picklist values so the solution would be record types.
Create two record types for accounts and the name are given below
USA Customers
International Customers
Follow the below steps to create the record types
Login to Salesforce
Navigate to Setup -> Object Manager
Click on the “Account” from the list.
Select “Record Types” from the left panel
Click the “New” Button
Provide the name
Click Next & Save
Repeat steps 4-7 and then create an International Customer Record Type.
Note: – Please make sure that the record types are active and available for the System Administrator Profile.
Configure Picklist Values
Now, we have set up the record types. The time is to configure the picklist values for Industry.
While you are on the account object page, Select Record Types from the left panel and select “USA Customers“.
It will open the record type detail page, where you will see the list of all picklist values.
Select Edit next to Industry picklist.
Make sure you have selected only the required values mentioned in the requirement.
Repeat the same steps for the International Customers Record Type.
Test the Setup
So far we have seen how to control the picklist values using record types.
We can also control what fields users see on the record detail page with the help of Page Layouts.
We can create a dedicated page layout for each record type.
Create page Layouts
You have done a fantastic job and your business is very happy with you. Now they are only seeing the picklist values which are required for them.
Requirement:– Users are complaining that they are seeing unnecessary fields on the detail page and those fields are not needed.
Below are the fields required for the USA Customers
Name
Phone
Rating
Industry
Parent Account
Account Record Type
Type
Description
Address
Here is the list of all fields that are required for international Customers
Name
Phone
Industry
Parent Account
Description
Account Record Type
Address
Website
Solution: As a Salesforce Admin, you have identified that page layout is the best solution for this.
Create two-page layouts for USA & International Customers.
Follow the below steps to create the page layout.
Login to Salesforce
Navigate to Setup -> Object Manager
Click on the “Account” from the list.
Select “Page Layouts” from the left panel
Click the “New” Button
Provide the name. For Example, USA Customers
Leave Existing Page Layout as blank
Click Save
You will be taken to the Edit page of Page Layout.
Drag & Drop the required fields into page payout
Click on Save
Please repeat Step 5 to Step 11 for International Customers Page Layout
Page layout Assignment
Perfect you have done an amazing job by creating the page layouts. Now, the time is to make sure that the correct page layout is assigned to the correct record type.
Follow the below steps to assign the page layout to record types
While you are on the account page select “Page layouts” from the left panel
Click the “Page layout Assignment” button.
Then Click on the “Edit Assignment” button.
Next to System Administrator or any other profile under “USA Customer” select all the rows and then select “USA Customers” from “Page Layout To Use”
Repeat step 5 for the International Customer page layout.
Click Save
Test this out
Congratulations!!!! You have done the setup of page layouts.
Create the account record with the different record types and notice the change.
Amit Singh aka @sfdcpanther/pantherschools, a Salesforce Technical Architect, Consultant with over 8+ years of experience in Salesforce technology. 21x Certified. Blogger, Speaker, and Instructor. DevSecOps Champion
The Salesforce CLI is not just a tool; it’s the cornerstone of development on the Salesforce Platform. It’s your go-to for building, testing, deploying, and more. As one of the most important development tools in our ecosystem
Table of Contents
What is Apex Log Analyzer?
Apex Log Analyzer, a tool designed with Salesforce developers in mind, is here to simplify and accelerate your...
Introduction
Hey Everyone,
Welcome to my podcast, the first-ever podcast in India for Salesforce professionals.
Achievement
We are happy to announce that we have been selected as Top...