Skip to main content
Skip table of contents

Customize the Behavior of a Lookup Field in Community Hub

Administrators can create an AutoCompleteSearch Configuration to customize the way a lookup field works in Community Hub. An AutoCompleteSearch Configuration can apply to all lookup fields on an object, all fields on a card, a specific field throughout Community Hub, or a specific field on a card. If further customization is needed, an AutoCompleteSearch Configuration can use a custom Apex controller.

  1. From Setup, enter Custom Metadata Types in the Quick Find box, then select Custom Metadata Types.
  2. Click Manage Records next to the AutoCompleteSearch Configuration custom metadata type.
  3. Click New.

  4. Enter Information - Provide some information used to identify and further customize this AutoCompleteSearch Configuration.
    1. In Label, enter an easily recognizable term to identify this product category using Pascal Case.
    2. AutoCompleteSearch Configuration Name is automatically populated.
    3. Optionally, if you need to customize a lookup field beyond the typical configuration, in Querier Class, enter the name of the custom Apex class to control the behavior of the lookup field. Development effort is needed to create a custom Apex class.
  5. Set Up Filters - Define whether this AutoCompleteSearch Configuration applies to all lookup fields on an object, all fields on a card, a specific field throughout Community Hub, or a specific field on a card.
    1. In Object Type, enter the API name of the object on which the lookup field is located. Example: Account or NU__Affiliation_c.
    2. In Field Name, enter the name of the lookup field you'd like to customize. This is useful when you want a specific lookup field to behave a certain way throughout all of Community Hub.
    3. In Card Name, enter the name of the card on which this configuration should apply. This is useful when you want all the fields on a card to behave in a certain way.
  6. Set Up Query Settings - Define what information is returned in lookup field searches and how it looks in Community Hub.

    1. In Maximum Results, enter the maximum number of search results that should be displayed as constituents type into the lookup field. This is 10 by default.

      To make the lookup field effective on all screen sizes, we recommend showing no more than 10 search results, and no fewer than 3.

    2. Optionally, in Minimum Search Length, enter the number of characters constituents must enter before search results display. If left empty, constituent must enter two characters before search results display.

      A value of 0 displays the maximum number of search results when constituents select the field.

    3. Optionally, in Primary Field, enter the name of the field used to sort search results and displayed as the heading for each search result on the lookup field. If left empty, the Name on the object is used.
    4. Optionally, in Field Set, enter the name of a field set containing fields on the object that should be searched against as constituents type into the lookup field. If the fields in this field set are populated, the values are displayed in the list of results as constituents search.

    5. Optionally, in Additional Filters, enter one or more conditional expression (WHERE clause), separated by commas, used to narrow the search results. Example:

      nu__PrimaryAffiliationRecord__r.nu__IsCompanyManager__c = True, nu__PrimaryAffiliationRecord__r.nu__IsPrimaryContact__c = False
  7. Click Save.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.