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 Typesin the
Quick Findbox, then select Custom Metadata Types.
- Click Manage Records next to the AutoCompleteSearch Configuration custom metadata type.
- Enter Information - Provide some information used to identify and further customize this AutoCompleteSearch Configuration.
Label, enter an easily recognizable term to identify this product category using Pascal Case.
AutoCompleteSearch Configuration Nameis 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.
- 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.
Object Type, enter the API name of the object on which the lookup field is located. Example:
- Optionally, in
Field Name, enter the name of the lookup field you'd like to customize. If this field is left blank, this configuration will apply to all lookup fields on the chosen
Object Type. This is useful when you want a specific lookup field to behave a certain way throughout all of Community Hub.
Card Name, enter the name of the card on which this configuration should apply. It will apply to lookup fields on the chosen
Object Typewhich have been added to the specific card. If this field is left blank, this configuration will apply to all lookup fields on the chosen
Object Type, regardless of the containing card. This is useful when you want all the fields on a card to behave in a certain way.
If you enter a
Card Name, the configuration will apply only to the specific field on the specific card. This is useful when you want a specific field on a specific card to behave a certain way.
In the case where you add a lookup field that's customized with an AutoCompleteSearch Configuration to a card that's customized with another AutoCompleteSearch Configuration, the field behaves based on the configuration for the field, rather than the configuration for the card.
Set Up Query Settings - Define what information is returned in lookup field searches and how it looks in Community Hub.
Maximum Results, enter the maximum number of search results that should be displayed as constituents type into the lookup field. This is
To make the lookup field effective on all screen sizes, we recommend showing no more than
10search results, and no fewer than
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
0displays 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, the
Nameon the object is used.
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.
Additional Filters, enter one or more conditional expression (WHERE clause), separated by commas, used to narrow the search results. Example:
- Click Save.