Ask Search:
Ben MertonBen Merton 

Lookup Search

If you have a contact lookup in a given object, how do you use the contact search lookup to return all the results for a given account?  At the moment, I only seem to be able to return results that are in the contact fields, but this is very inflexible...
Steve MolisSteve Molis
 It might not solve the problem entirely, but you might want to try customizing the Contact Search settings

Customizing Search Layouts

Available in: All Editions

User Permissions Needed
To change search layouts:“Customize Application”

Customize which fields display for users in search results, search filter fields, lookup dialogs, the recent records lists on tab home pages, and in lookup phone dialogs for Salesforce CRM Call Center. You can specify a different set of fields to show in each search layout. The settings apply to all users in your organization and Salesforce Customer Portal.

Additionally, customize which buttons display in custom list views and search results. You can hide a standard list view button or display a custom button. Standard buttons are not available on search result layouts. To display a custom button, create the custom button and give it a “List Button” Display Type.

  1. Click Your Name | Setup | Customize, select the appropriate activity or tab link, and choose the Search Layouts link.
  2. Click Edit next to the layout you want to customize. You can specify a different set of items to display for search results, lookup dialogs, recent records lists on tab home pages, lookup phone dialogs, list views, and search filter fields.
  3. For list view and search results layouts, select any standard or custom buttons you want to display. To hide a standard button on the list view, deselect it. Standard buttons are not available on search result layouts.
  4. Use the arrows to add or remove items from the layout, and to define the order in which the fields should display. To select more than one item, use CTRL+click or SHIFT+click to select multiple items in a range.
    • Select one or more items in the available list and click Add to add them to the layout.
    • Select one or more items in the selected list and click Remove to remove them from the layout.
    • Select one or more items in the selected list and click Up to move them higher in the list.
    • Select one or more items in the selected list and click Down to move them lower in the list.
    Note
    When editing a search results layout for an object, you can select the Override the search result column customizations for all users checkbox. If selected, all user column customizations within your organization will be overwritten and set to the organization-wide default settings.
  5. Click Save.

Notes on Search Layouts

  • Search layouts do not apply to Salesforce CRM Content. To search for files and Web links in Salesforce CRM Content, see Searching for Content.
  • Search layouts do not apply to campaign members.
  • The search layout does not determine which fields are searched for keyword matches. See Search Fields for a list of which fields are searched.
  • You can add up to 10 fields to each search layout.
  • You cannot remove unique identifying fields, such as Account Name or Case Number, from the search layouts. These fields must be listed first in the order of fields in the search layout.
  • You cannot add long text fields such as Description, Solution Details, or custom long text area fields to search layouts.
  • All fields are available to be added to the search layout even if some fields are normally hidden for the user customizing the search layout.
  • For Enterprise, Unlimited, and Developer Edition organizations, search layouts do not override field-level security. If a field is included in the search layout but hidden for some users via field-level security, those users do not see that field in their search results.
  • For Personal, Contact Manager, Group, and Professional Edition organizations, search layouts override page layout settings. If a field is included in the search layout but hidden in the page layout, that field will be visible in search results.
  • The search results layouts for leads, accounts, contacts, and opportunities also apply to the search results displayed when finding duplicate leads.
  • Formula fields are not available in search result layouts.
  • Do not remove the Phone field from any lookup phone dialogs search layout. If you do so, users will not be able to use the directory search results to enter a phone number into a SoftPhone dial pad.
  • To add a custom button to a list view or search layout, create the custom button for a standard or custom object, giving it the “List Button” Display Type. The custom button will be available in the list view and search result layouts for that object.
Tip
In account search results, you can visually differentiate business accounts from person accounts by adding the Is Person Account field, which displays as the person account icon (Person Account Icon).

You may specify the Is Person Account field as the first column in account search layouts. Otherwise, Account Name must be the first column.

For more information, see What is a Person Account?.

Steve MolisSteve Molis
 If the records have a Master-Detail Relationship you could try using a Lookup Filter

About Lookup Filters

Available in: All Editions

User Permissions Needed
To manage lookup filters:“Customize Application”
Note
Salesforce beta features are production-quality but are not functionally complete.

Improve user productivity and data quality with lookup filters.

Lookup filters are administrator settings that restrict the valid values and lookup dialog results for lookup, master-detail, and hierarchical relationship fields. Administrators specify the restrictions by configuring filter criteria that compare fields and values on:
  • The current record (source)
  • The lookup object (target)
  • The user's record, profile, and role
  • Records directly related to the target object
For example, you can:
  • Restrict the Account Name field on opportunities to allow only accounts with a record type of Customer, filtering out Partner and Competitor.
  • Restrict the Account Name field on opportunities to allow only active accounts.
  • Restrict the Contact field on cases to allow only contacts associated with the account specified in the Account Name field on the case record.
  • Restrict the Account Name field on cases to allow only users with the “International Sales” profile to create or edit cases for accounts outside the United States.
Tip
When you define a lookup filter, optionally click Insert Suggested Criteria to choose from a list of lookup filter criteria that Salesforce suggests based on the relationships between objects in your organization.
Administrators can make lookup filters required or optional.
  • For fields with required lookup filters, only values that match the lookup filter criteria appear in the lookup dialog. Also, users can't save invalid values manually typed in the field when editing the record. If a user tries to save an invalid value, Salesforce displays an error message, which administrators can customize.
  • 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.