Auto-complete for reference fields
By default, a reference field auto-completes as the user types in the field.
Dictionary attributes for auto-completion of reference fields
There are dictionary attributes that are specific to reference fields and that determine auto-complete behavior.
| Attribute | Description |
|---|---|
| ref_auto_completer | Specifies the name of the client-side JavaScript class that creates the
drop-down auto completion choices. Valid class values include:
|
| ref_ac_columns | Specifies the list of reference table columns to display. Separate column names with a semi-colon. For example, ref_ac_columns=user_name;email;sys_created_on allows auto-complete to match text from the user_name, email, and sys_created_on columns. |
| ref_ac_order_by | Specifies the reference table column that sorts the auto-completion choices. For example, ref_ac_order_by=name sorts the auto-completion choices alphabetically by name. |
Define auto-complete attributes for all references to a table
A field inherits and uses the reference table's auto-complete attributes unless the field has its own value for the same attributes. You can define the attributes for references to a table, and it affects every form that references that table.
Before you begin
About this task
A field-level attribute overrides a table-level attribute of the same name. If a field uses different reference attributes from those that are defined for the reference table, then the field uses both sets of attributes.
Procedure
What to do next
Remove the display value column
You can remove the display value column from a reference field by setting the ref_ac_display_value attribute to false.
Before you begin
About this task
This example describes how to remove the display value column from references to the User [sys_user] table and replace it with references to the first_name and last_name columns.
Procedure
What to do next
Improve auto-complete queries
By default, all reference fields use a starts with query to search for matching text in the reference table. This prevents auto-complete from executing inefficient contains queries every time a user searches a reference field. You can require all reference fields to use a starts with query.
Before you begin
About this task
This procedure describes how to change the glide.ui.ref_ac.startswith system property to always use a starts with query.
Procedure
Configure auto-complete to match text from any reference field
By default, auto-complete only matches text in the display value column. You can configure a reference field to match text from any additional column the reference field displays.
Before you begin
About this task
You can add the ref_ac_columns_search attribute to enable auto-complete to match text in any column listed in the ref_ac_columns attribute. Set the ref_ac_columns_search attribute to true to match text from all reference field columns. By default (or when this attribute is false) auto-complete only matches text in the display value column.
Procedure
Example
ref_auto_completer=AJAXTableCompleter ,ref_ac_columns =sys_class_name ,ref_ac_order_by =sys_class_name ,ref_contributions =task_show_ci_map ;ci_show_incidents
Enable contains auto-complete searches
By default, the reference auto-complete uses a starts with search. A user preference can be created to implement a contains search.
Before you begin
Procedure
What to do next
Wildcards in reference auto-completes
Wildcard searches use the auto-complete functionality.
Use an asterisk in the reference field for wildcard searches.
If two asterisks are entered, a list of available records display in the auto-complete suggestions.