Enforcing selection of active records for optional lookup filters
Using the Lookup window, you can search for a specific record. When you click a lookup icon, a separate window is displayed with the list of active records.
For fields with optional lookup filters, only values that match the lookup filter criteria appear in the lookup dialog initially; however, you can click the Show All Results link in the lookup dialog box to remove the filter and view all search result values for the lookup field.
For Category and Template lookups, if you select inactive records and click Save, you receive an error message.
For all other Optional lookup filters, you do not receive an error message if you try to save inactive values. However, if you want to make it mandatory for the user to select an active record for the object, you must add validation rule for that field of object.
For example, to create a validation rule for Urgency field, perform the following steps:
- Navigate to Setup > Create > Objects.
- Click Incidents.
- In the Validation Rules section, click New.
- In the Error Condition Formula editor, ensure that you have the following value:
where BMCServiceDesk is the namespace of organization.
- In the Error Message field, type Select active Urgency.
- Select the Active check box and click Save.