Loading

Lookup field filter does not work on record creation

Data pubblicazione: Oct 13, 2022
Descrizione

When a filter has been implemented on a lookup field, users may find that they're unable to locate related records via the lookup dialog search when they create a new record despite records existing and matching the filter's criteria. Users will also find that the same lookup search returns the expected records upon editing the newly created and saved record.

For Example:


1. Create a custom lookup field on the Case object to Opportunity.

2. Create a custom lookup field on the Quote object to Case and add a filter with the following criteria:
Quote: Opportunity ID equals Field Case: Opportunity: Opportunity ID

3. Create an Opportunity record and then several Case records associated with the Opportunity.

4. Open the Opportunity created in Step 3, and create a new Quote record via the Quotes-related list.

5. In the Case lookup field, try to search for the cases you created in Step 3.

 

When you create the Quote record, you're unable to locate the Case records via the filtered lookup. However, if you click "Show all results" to remove the filter the expected results are returned or if you input a matching case number into the lookup field on the Quote edit page (without searching) you're able to save the record and the lookup filter works when editing an existing record.

Risoluzione
If your lookup filter criteria use a Master-Detail (M-D) relationship, the lookup filter will not work upon record creation.

This behavior is working as designed and a limitation of lookup field filters not being able to leverage M-D relationship fields in lookup filter criteria. Only relationships of Data Type: Lookup can be used to establish lookup filter criteria to properly reference related object records during record creation.

In the example scenario provided above, since the record being created (Quotes) is in an M-D relationship with Opportunities, the lookup's filter doesn't have the ability to span the Quote to Opportunity relationship on record creation. However, if the Quote to Opportunity relationship field was of type Lookup the filter logic would be able to properly span the filter's relationship path.

As a workaround to this lookup dialog search limitation, consider removing the lookup's filter or populating the field after the record has been created.


See Also:
Considerations for Lookup Filters
Expected results not available in a lookup search when you use lookup filters
Standard and Enhanced Lookups in Salesforce Classic
Numero articolo Knowledge

000383698

 
Caricamento
Salesforce Help | Article