I am not able to search a contact that is present in the lookup filter? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Neha KakrooNeha Kakroo 

I am not able to search a contact that is present in the lookup filter?

Hi,

There is a contact in the application. But when I try to search for this contact through lookup filter, I get the message the value does not exist. I am not able to find this contact in the lookup filter.

Can somebody tell me why this is happening?

Thanks!
Nebojsa (Nash) ZgonjaninNebojsa (Nash) Zgonjanin
Check your lookup filter:

Notes on Lookup Filters

Available in: All Editions except for Database.com.

User Permissions Needed
To manage lookup filters:“Customize Application”

Best Practices

Custom Help
Define custom help for fields with lookup filters to let users know about the business rule the filter enforces. For example, if the lookup filter restricts the Account Name on opportunities to only allow active accounts, define custom help that states You can only associate active accounts with opportunities.
Error Messages
Customize lookup filter error messages to guide users who type invalid values. For example, if the lookup filter restricts the Account Name on opportunities to only allow active accounts, define an error message that states Value doesn't exist or isn't an active account. Important
Salesforce translates the standard error message for required lookup filters, but not custom error messages. Use the Translation Workbench to translate lookup filter custom error messages. To restore the standard error message after modifying it, click Reset to default message.
Profile-Based Lookup Filters
Use Current User Profile: ID in filter criteria to define different filter criteria for different users, or to let administrators enter values that don't match the criteria. Avoid using Current User Profile: Name due to technical limitations on standard profiles. See Lookup Filter Examples.
Record IDs vs. Record Names
To reference a specific record in filter criteria, use the ID of the record instead of its name. IDs are always unique whereas names are not.
Testing
After creating a lookup filter, test it to make sure it is not too restrictive. Depending on their permissions, some users may have read-only access to some relationship fields; ensure your lookup filters don't prevent those users from editing records critical to their job functions.
Dependent Lookups on Page Layouts and Mini Page Layouts in the Console
When designing page layouts with dependent lookups:
  • If a dependent lookup is above its controlling field on a layout, make its lookup filter optional or redesign the layout. Moving a required dependent lookup above its controlling field may confuse users who typically start from the top of a page when entering data.
  • Ensure that both the controlling and dependent fields are visible so users can correct invalid values.
Lookup Filters and the Lookup Filter Fields Search Layout
Do not reference the same fields in both lookup filter criteria and the Lookup Filter Fields search layout. Users might assume that results from their custom search override administrator-controlled lookup filters.

Implementation Notes

  • Salesforce supports lookup filters on relationship fields that point to:
    • Accounts
    • Assets
    • Contacts
    • Entitlements
    • Quotes
    • Service contracts
    • Users
    • Custom objects
    For example, you can define a lookup filter on opportunities that points to accounts, but not vice-versa.
  • Lookup filter criteria can compare fields on the source object with different types of fields on the target object as long as the fields are compatible.
    Source Object Field TypeCompatible Target Object Field Types
    CurrencyCurrency, Roll-Up Summary
    DateDate, Date/Time, Roll-Up Summary
    Date/TimeDate, Date/Time, Roll-Up Summary
    HierarchyHierarchy, Lookup, Master-Detail
    LookupHierarchy, Lookup, Master-Detail
    Master-DetailLookup, Hierarchy, Master-Detail
    NumberNumber, Percent, Roll-Up Summary
    PercentNumber, Percent, Roll-Up Summary
    PicklistText, Text Area, Email, URL
    Roll-Up SummaryCurrency, Number, Date, Date/Time, Roll-Up Summary
  • Lookup filter criteria cannot reference the following types of fields on the source object:
    • Autonumber
    • Encrypted
    • Formula
    • Long text area
    • Multi-select picklist
    • Roll-up summary
    • Text
    • Text area
    • URL
  • On the Fields page, the Required Lookup Filter icon indicates all fields with active lookup filters. The Required Lookup Filter icon indicates that the lookup filter is required.
  • If you enter Current User Profile: Name or Profile: Name in the Field column of your lookup filter criteria, Salesforce displays a lookup icon in that row. Click the lookup icon to select from a list of existing profiles rather than typing profile names.
  • The lookup filters you create in Salesforce also appear in the partner portal and Customer Portal.
  • Lookup filters are case-sensitive.
  • If you convert a required lookup filter with a custom error message to optional, Salesforce deletes the message.
  • If you create a lookup filter that invalidates an existing value for that field, the value persists; however, when a user edits the record, Salesforce displays an error message and requires the user to change the invalid value before saving.
  • Salesforce prevents you from saving changes that cause required lookup filters on related records to contain invalid values.
  • Lookup auto-completion doesn't work for user lookups with additional drop-down lists. This is primarily for organizations that have set up either a partner portal or Customer Portal.
  • Salesforce ignores lookup filters when converting leads if the Enforce Validation and Triggers from Lead Convert checkbox on the Lead Settings page is deselected.
  • Versions 16.0 and higher of the Salesforce API support lookup filters. Lookup filters are enforced when you load data through the API.
  • If you configure a lookup filter to show inactive users only, the relationship field has no valid options because inactive users are never valid for relationship fields that point to the User object.
  • In enhanced list views, you cannot change fields that a dependent lookup filter criteria references.
  • Lookup filters do not support mass owner changes. If your lookup filter criteria reference the Owner field, performing a mass owner change can result in incorrect values that won't be noticed until you attempt to save the record.
  • Lookup filters cannot reference formulas that reference global merge fields that lookup filters do not support.
  • If you create a filtered lookup on a field that looks up to another object, both objects must be deployed into the organization at the same time.
  • Salesforce does not display an error message if the value of a controlling field invalidates the value of a dependent master-detail relationship field.
  • Salesforce does not support inline editing in list views for:
    • Fields on the source object that are referenced in dependent lookups.
    • Fields with dependent lookups.

Spanning Relationships in Lookup Filters

Filter criteria can include fields directly related to the target object (one level only). For example, on a lookup field pointing to contacts, a lookup filter can reference fields on the account related to the contact via the Account Name relationship field. The lookup field can also reference fields on the contact related to the contact via the Reports To relationship field.

For required lookup filters, each field referenced on a related lookup object counts against the number of unique relationships allowed for the referenced object, not the source object. For example, the two unique relationships described above count against the number allowed for the Contact object. Optional lookup filters don't count against the limit on the number of unique relationships allowed per object.

To see which lookup filters affect the limit for a particular target object:
  • For standard objects, click Your Name | Setup | Customize, select the object from the Customize menu, and click Related Lookup Filters.
  • For custom objects, click Your Name | Setup | Create | Objects, select one of the custom objects in the list, and scroll to the Related Lookup Filters related list.

Lookup Filters vs. Validation Rules

Validation rules and lookup filters achieve similar ends, but offer different advantages. Use a lookup filter if: Use a validation rule if:
  • You're close to the maximum number of lookup filters allowed.
  • You must implement a complex business rule that requires you to use a formula. Formulas can reference fields that basic filter criteria can't reference, such as fields on the parent of the source object. Formulas can also use functions. For example, use ISNEW if the rule should only apply on record creation, or ISCHANGED if the rule should apply when a field changes.

Other Limitations

  • Lookup filter criteria can reference fields on accounts, assets, contacts, entitlements, quotes, service contracts, users, and custom objects, with the following exceptions:
    • Relationship fields on activities
    • System fields that are always read only, such as Created By and Modified By
    • Relationship fields that support queues, such as Case Owner, Lead Owner, and Delegated Approver
  • Each object can have up to five active required lookup filters and an unlimited number of optional lookup filters. If you reach the limit of required lookup filters for an object, create optional filters instead and use validation rules to enforce your business rule when a user saves.
  • Lookup filters on currency fields don't convert currencies. For example, if your organization uses multiple currencies and a lookup filter criteria is Expected Revenue greater than 100000, the lookup shows all records with an Expected Revenue field value greater than 100,000, regardless of the currency.
  • You can't use special date values, such as “Today” or “This Month,” in lookup filter criteria.
  • You can't delete fields that are referenced in an active lookup filter.
  • You can't change the field type of fields referenced by an active lookup filter.

Using Lookup Filters with Person Accounts

If your organization uses person accounts, note the following:
  • Person Accounts don't support Contact filters; however, Person Accounts support Account filters. For example, if the Account field has a dependent lookup filter that's added to a Person Account, dependent lookups are supported. If the Contact field has a dependent lookup filter that's added to a Person Account, dependent lookups isn't supported.
  • Lookup filter criteria on Account Name only apply to business accounts, not person accounts. For example, if your lookup filter criteria is Account Name does not contain book, business accounts with "book" in the name, such as John's Bookstore, are not valid, but person accounts with “book” in the name, such as John Booker, are valid and appear in the lookup dialog for the Account field. If you need to filter on the name for a person account, use the First Name or Last Name fields instead.
  • Use the Is Person Account field in your lookup filter criteria to restrict the valid values of a lookup field to one type of account (either person accounts or business accounts). For example, to restrict a lookup to only person accounts, include the following in your lookup filter criteria: Is Person Account equals True.
  • You can't package lookup filters that reference standard fields specific to person accounts, such as the Email and Title fields.

James RossJames Ross
Are you using Person Accounts?
James RossJames Ross
Enable Enhaced Lookups for the object in question. In your case Contacts.
Click Your Name -> Setup -> Customize -> Search -> Search Settings
Ajay B RAjay B R
Hi everyone,
Sorry for posting a question in answer blog.
But i desperately need help.

I have a lookup field (referring a Custom Object) in activity with a lookup filter on Account (a Custom lookup field). It seems to be working in New Task/New Event page although it is mentioned that Lookup filters on activities cannot reference relationship fields. But the issue is - In "Log a Call" page, the lookup filter is working in the current call related fields, but it is not working in the "Schedule Follow-up task" Section fields. Can some body help me here.

Thanks & Regards
Ajay
Arun KumarArun Kumar

Hi Neha,

I think you have narrowing down the search in the filet criteria. So Kindky go tho that object and then to Contact field which is lookup to the Contact and then there you can remove filter condition.

Thanks,

Arun
 

Rob MouritsenRob Mouritsen
Arun Kumar's answer addressed the problem for me regarding not seeing all the Users in a lookup field. Thanks, Arun!

(You'll see a little filter icon with a red asterisk on the field in the Data Type column of the Custom Fields & Relationships section of the object).
Thomas MillerThomas Miller
if your problem was related to this https://success.salesforce.com/ideaView?id=08730000000kwkfAAA please give it an upvote.