How to show “Name – Site Code” in reference autocomplete?

LokeshwarRV
Tera Contributor

I have a reference field where autocomplete search works using:

ref_auto_completer=AJAXReferenceCompleter,
ref_ac_columns=name;u_site_code,
ref_ac_columns_search=true

I can search by name and site code, but the autocomplete dropdown still shows only the name (display value).

Is there any supported way to display Name – Site Code together in the autocomplete results, or does autocomplete only show the display value?

Thanks!

1 REPLY 1

Brad Bowman
Kilo Patron

The display column will always be shown in the search results, so you don't really need to include it in the ref_ac_columns attribute.  Adding the site code field here should show the field in the search results, provided the field name is exactly correct.  To be clear, this is the list of records that match the search criteria, which is different than the display value of the selected record, which will always only show the display field.

 

For example, if I add ref_ac_columns=first_name;last_name to the attributes on the out of box caller_id field on the incident table, it will look like this:

BradBowman_0-1768942562462.png

but once I select a record, it just shows the display field

BradBowman_1-1768942604722.png