+ Start a Discussion

create a filtered look-up list on custom child object using criteria from another related object



I need to find an easy way to provide a filtered look-up list to en end user when relating to another object. I have 2 custom child objects on the opportunity object named "Enhancement Request" and "Feature Commitment", respectively. User creates Enhancement requests which are automatically associated with the opportunity. A 3rd custom object named "Feature" would eventually get associated with the "Enhancement Request". "Feature Commitment" is simply an object that links Opportunity to Feature. When creating a "Feature Commitment", the lookup field to "Features" pulls entire list of Features in the table. What I would like to do is create a filtered look-up page that only provides Features associated with the "Enhancement Requests" related on that particular opportunity record. Any tips would be appreciated.


Hi jd_labbe,


Try this:


To define a lookup filter:

  1. You can create lookup filters for new relationship fields in step 3 of the custom field wizard. To create a lookup filter on an existing field:
    1. Navigate to the fields area of the object that contains the relationship field:
      • For standard objects, click Your Name | Setup | Customize, select the appropriate object from the Customize menu, and click Fields.
      • For custom objects, click Your Name | Setup | Create | Objects, and select one of the custom objects in the list.
    2. Click Edit next to the name of the lookup or master-detail relationship field to which you want to apply the filter.
  2. In the Lookup Filter Options section, click Show Filter Settings.
  3. Specify the filter criteria a record must meet to be a valid value. To specify criteria, click Insert Suggested Criteria and choose from a list of suggested criteria, or manually enter your own criteria. To enter your own criteria:
    1. In the first column, click the lookup icon or start typing in the text box and select a field.
    2. In the second column, select an operator.
    3. In the third column, select Value if Salesforce should compare the field in the first column with a static value, or select Field if Salesforce should compare the field in the first column with the value of another field.
    4. In the fourth column, enter the value or select the field that Salesforce should compare with the field in the first column.
    • Click Add Filter Logic to add Boolean conditions.
    • You can select from fields on the current record, the lookup object, or the user record. You can also choose related fields that are one relationship away from the lookup object. Salesforce assists you by listing the available fields and relationships when you click the lookup icon or click inside the text boxes.
    • Lookup filter criteria can compare fields of different types as long as they are compatible.
  4. Specify whether the filter is required or optional. For fields with optional lookup filters, only values that match the lookup filter criteria appear in the lookup dialog initially; however, users can click the Show all results link in the lookup dialog to remove the filter and view all search result values for the lookup field. Also, optional lookup filters allow users to save values that don't match the lookup filter criteria, and Salesforce does not display an error message if a user tries to save such values.

    For required lookup filters, specify whether you want Salesforce to display the standard error message or a custom message when a user enters an invalid value.

  5. Optionally, enter text to display in the lookup search dialog. Consider text that guides users in their searches and explains the business rule that the lookup filter implements.
  6. Leave Active selected.
  7. Click Save.

Hope this helps.