Create two fields so that the value that you select in the first field determines the values that you can select in the second field.
The objective of this tutorial is to create a department and a subdepartment field on the People page. The department that a user selects determines the subdepartment that the user can select. For example, when IT is selected as the department, either cloud services or security can be selected as the subdepartment.
Lessons
In this tutorial, you will learn how to create a department object that has two records:
- A record for an IT department
- A record for a human resources department
You will also learn how to create a subdepartment object that has four records:
- A record for an administration subdepartment
- A record for a cloud services subdepartment
- A record for a recruitment subdepartment
- A record for a security subdepartment
Then, you will open the Data model page and add two new fields to People records:
- The Department field
- The Subdepartment field
Contents
- Creating the department object
- Creating the subdepartment object
- Add the department and the subdepartment fields to user records
Creating the department object
- Click Configuration > Data Model > Objects.
- Click Add .
- Type Department as the name of the object and enter a description.
- Click Save.
- Refresh the screen.
Adding the records
Add a record for IT and a record for human resources to the Department object.
- On the Data Model > Objects page, search for the Department object.
- Click the value in the Total records column.
- Click Add .
- Add and save the IT record.
- Repeat Step 3 to Step 5 to add the Human Resources record
Tip
Save time when you add multiple records. When you save a record, click Save & New instead of Save.
Creating the subdepartment object
- Click Configuration > Data Model > Objects.
- Click Add .
- Type Subdepartment as the name of the object and enter a description. The Object type is Lookup Object.
- Click Save.
- Refresh the screen.
Adding the department field to the subdepartment record
You add a department field so that you can associate each subdepartment with a department.
- Click Configuration > Data Model > Field Configuration.
- Select Subdepartment from the Objects list.
- Click Add .
- Type Department as the name.
- As data type select Department.
- Click Create.
Adding subdepartment records
Add a record for each subdepartment and associate each subdepartment with a department.
You add a record for each of the following subdepartments and associate a department with each subdepartment:
- Administration is a subdepartment of the human resources department.
- Cloud Services is a subdepartment of the IT department.
- Recruiting is a subdepartment of the human resources department.
- Security is a subdepartment of the IT department.
- On the Data Model > Objects page, type Subdepartment as the name of the object in the search field.
- Click the value in the Total records column.
- Click Add .
- Enter the name of the subdepartment such as Administration.
- In the Department dropdown, select the name of the associated department such as Human Resources.
- Click Save.
- Repeat Step 3 to Step 6 to create all of the records.
Add the department and the subdepartment fields to user records
You want to add two new fields to user records so that when a user adds or edits a record, they can select a department and subdepartment.
Creating the department field
- Click Configuration > Data Model > Field Configuration.
- Select Users from the Objects list.
- Click Add .
- Type Department as the field name.
- As data type, select Department from the list.
- Click Create
Creating the subdepartment field
- Click Configuration > Data Model > Field Configuration.
- Select Users from the Objects list.
- Click Add .
- Type Subdepartment as the field name.
- As data type, select Subdepartment from the list.
- Click Display Option.
- Select Filtered Dropdown. The Department is linked to the Custom object list.
- Click Create.
Result
The department and subdepartment fields you created are visible in the user record.
Comments
0 comments
Please sign in to leave a comment.