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 Departments field
- The Subdepartments field
Creating the department object
- Click Configuration > Objects.
- Click Add
.
- Type Department as the name of the object and enter a description. The Object type is Lookup Object.
- 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 Objects page, type Department as the name of the object in the search field.
- Click the value in the Total records column.
- Click Add
.
- Add the IT record.
- 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 > Objects.
- Click Add
.
- Type Subdepartments as the name of the object and enter a description. The Object type is Lookup Object.
- Click Save.
Adding the department field to the subdepartments record
You add a department field so that you can associate each subdepartment with a department.
- Click Data model.
- Select Subdepartments from the Objects list.
- Click Add
.
- Type Departments as the name.
- As data type select Departments.
- 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 Objects page, type Subdepartment as the name of the object in the search field.
- Click the value in the Total records column.
- Click Add
.
- Type the name of the subdepartment such as Administration.
- In the Departments field, type the name of the associated department such as Human Resources.
- Click Save.
- Repeat Step 3 to Step 6 to create all of the records.
Creating the department and the subdepartment fields
You want to add two new fields to People 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.
- Select People 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.
- Select People 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.
- Click Create
Comments
0 comments
Please sign in to leave a comment.