Filtered dropdown lists provide the ability to create dynamic dropdown fields that provide different choices depending on the value selected in the previous field.
Contents
Creating the custom objects
In order to create a filtered field, you must first create custom objects that define the values in your dropdown list.
In the example below our custom objects are called Department and Subdepartment.
Creating the Department custom object
The Department custom object will define how the options in the first dynamic dropdown are determined.
- Navigate to Configuration>All Custom Objects.
- Click the Add(+) button in the upper right. Name your custom object Department and give it a description.
- Specify the Object type as Lookup Object.
- Click Save.
- Navigate to All Custom Objects again and select Custom objects:Department from the list.
- Click Add(+) in the upper right to add records that you would like to appear in your dropdown list. In the example below two records are added to the Department custom object: IT and Human Resources.
Creating the Subdepartment custom object
The Subdepartment will define how the options in the second dynamic dropdown are determined.
- Navigate to Configuration>All Custom Objects.
- Click the Add(+) button in the upper right. Name your custom object Subdepartment and give it a description. Specify the Object type as Lookup Object.
- Click Save.
Linking the custom objects
Link the custom objects so that the options of the second dropdown depend on the content selected in the first dropdown. In the example below, the Subdepartment is linked with the Department custom object.
- Navigate to All Custom Objects again and select Custom objects:Subdepartment from the list.
- Select Customization.
- Click the Add(+) button.
- Enter Department as the field name.
- Select Department from the Data Type dropdown.
- Navigate to All Custom Objects again and select Custom objects:Subdepartment from the list.
- Click Add(+) in the upper right to add records. In the example below four records were added to the Subdepartment custom object: Cloud Services, Security, Administration and Recruiting.
- From the Department dropdown, select IT or Human Resources.
Creating the Dynamic Dropdown
Now that you have the custom objects created, you can create and then link the fields.
Creating the Department custom field
- Navigate to a module, for example Assets, and then select Customization.
- Click Add to add a new field.
- Enter Department as the field name.
- In the Data type dropdown, select the Department custom object that you created in Creating the Department custom object.
- In the Display Option tab, ensure that the Display option is set to Regular.
- Click Create.
Creating the Subdepartment custom field
- Go to Assets>Customization again and click Add.
- Enter Subdepartment as the field name.
- In the Data type dropdown, select the Subdepartment custom object that you created in Creating the Subdepartment custom object.
- In Display Option tab, select Filtered Dropdown.
- Ensure that the Custom object field is pointing to Department and the field name defined in Asset field is correct. In the example below, the Subdepartment field will filter based on the Department field.
Result
Now when you add a Department to a record, the SubDepartment values will dynamically populate based on the value set in the Department field.
Comments
0 comments
Please sign in to leave a comment.