Create Lookup Filters | Trailhead Screen Reader Instructions

Introduction

Lookup filters limit the records available in the lookup. A lookup filter can reference other fields on the same record (source); fields on the records of the lookup object (target); fields on the user's record, profile, and role; and fields on records directly related to the target object.

You’ve gotten a request from Noah Larkin, VP of Services, who would like reps to be able to capture the name of the backup rep on their cases when they are away from the office. He also wants to ensure that new cases can only be associated to contacts from the same account. To get this job done, create a lookup filter.

 

Create a Lookup Relationship

Create a new Backup Agent field that looks up to the User object, editable by Support Users only.

  1. From Setup, select the Object Manager tab and select Case from the object table.
  2. Select the Fields & Relationships tab and activate the New Custom Field button.
  3. Select Lookup Relationship as the Data Type, then press ENTER on Next.
  4. Select User from the Related To combo box, then activate the Next button.
  5. Rename the Field Label Backup Agent.
  6. Rename the Field Name Backup_Agent.
  7. For Description, enter:
    Used to identify the assigned support rep when case owner is away — for support use only.
  8. For Help Text, enter:
    Who is the assigned support rep when case owner is away?
  9. Under the Lookup Filter heading, activate the link for Show Filter Settings.
  10. Activate the  lookup link just past the Value / Field edit box to select the Field, and fill in the filter details.
  11. Select User from the first combo box, Profile from the second combo box, and name from the third combo box which will appear once you choose Profile.
  12. Activate the Insert button.
  13. Select Equals in the Operator combo box.
  14. Select Value in the Value combo box.
  15. In the edit field for Value, type Support User
  16. Leave everything else as is and activate the Next button.
  17. In the Read-Only column header, select the checkbox.
  18. In the Read-Only column, deselect the Support User checkbox.
  19. Activate the Next button.
  20. Deselect the checkbox for the Close Case Layout.
  21. Activate the Save button.

 

Add a filter to the case Contact Name field so that users can only select contacts related to the account selected in the case Account Name field.

  1. While still viewing the Case object, select the Fields & Relationships tab.
  2. Select Contact Name from the table of fields, then activate the  Edit button.
  3. Under the Lookup Filter heading, activate the link for Show Filter Settings.
  4. Press ENTER on the Lookup link next to the Value / Field edit box, and fill in the filter details. Note that when you see two fields separated by a colon in the table below, this indicates you should select the first value from the first combo box that appears, and the second value from the next combo box on the page.
    Field Operator Value/Field
    Contact Name: Account ID Equals Field / Case: Account ID
  5. Ensure the Required radio button is selected for Filter Type.
  6. Leave everything else as is and activate the Save button.

You’ve taken care of Noah’s request by creating a lookup filter. Keep making things better for the AW Computing team in the next step, where you work with custom formula fields.

Click to return to the unit on Trailhead to verify this step.