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.
- From Setup, enter
Custom Metadata Types
in theQuick Find
box, then select Custom Metadata Types. - Click Manage Records next to the AutoCompleteSearch Configuration custom metadata type.
Click New.
- Enter Information - Provide some information used to identify and further customize this AutoCompleteSearch Configuration.
- In
Label
, enter an easily recognizable term to identify this product category using Pascal Case. AutoCompleteSearch Configuration Name
is automatically populated.- 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.
- In
- 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.
- In
Object Type
, enter the API name of the object on which the lookup field is located. Example:Account
orNU__Affiliation_c
. - 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. - 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.
- In
Set Up Query Settings - Define what information is returned in lookup field searches and how it looks in Community Hub.
In
Maximum Results
, enter the maximum number of search results that should be displayed as constituents type into the lookup field. This is10
by default.To make the lookup field effective on all screen sizes, we recommend showing no more than
10
search results, and no fewer than3
.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.- 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, theName
on the object is used. 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.Optionally, in
Additional Filters
, enter one or more conditional expression (WHERE clause), separated by commas, used to narrow the search results. Example:SQLnu__PrimaryAffiliationRecord__r.nu__IsCompanyManager__c = True, nu__PrimaryAffiliationRecord__r.nu__IsPrimaryContact__c = False
- Click Save.