How to Enable "Last Name First Name" Search in Requested For Reference Field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I'm working on improving the search behavior of the standard Requested For reference field. The requirement is that users should be searchable regardless of whether the search starts with the first name or the last name. For example, for a user record named Abraham Lincoln, searches such as Abraham, Abraham Lincoln, and Lincoln should all return the correct user record. Initially, searches using the surname followed by the first name, such as Lincoln Abraham or Lincoln A, were not returning any results.
To address this, I configured the reference field with:
This successfully enabled searching by username, first name, and last name individually. However, searches using the combined format Last Name + First Name (for example, Lincoln Abraham) still do not return any matches, even though both values exist on the user record.
Has anyone encountered this requirement before and found a way to support searching against a concatenated value such as last_name + first_name for the standard Requested For field? Is there a recommended approach using reference auto-completers, advanced reference qualifiers, search attributes, or a custom solution that would allow users to search in the Last Name First Name format without affecting the existing search functionality?
Any insights or best practices would be greatly appreciated.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Sachithananda 1 ,
Yes, you can use:
ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true,ref_ac_columns=user_name;first_name;last_name
This will allow users to search by username, first name, or last name. However, it will not support a combined search like Lincoln Abraham, because ref_ac_columns_search=true does not concatenate the fields.
I would avoid changing the standard sys_user data just for this requirement. If Last Name First Name search is mandatory, a custom autocomplete/search solution would be a better approach rather than adding custom data to sys_user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @Sachithananda 1 ,
you are correct , most of time we use ref_auto_completer=AJAXTableCompleter,ref_ac_columns=fieldName;field_name,ref_ac_columns_search=true
attributes to enable search by other fields .
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
I’ve run into similar reference field search issues. ref_ac_columns works well for individual fields, but it won’t usually handle a custom combination like last_name + first_name on its own. A custom autocomplete or a searchable field that stores the combined name may be a cleaner option, depending on how much you want to change the standard Requested For behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @Sachithananda 1 ,
Alternatively you can also make use of :
User Administration > User Preferences > create new record..
Name : <tablename>.autocomplete.contains
System : true
Type : True/False
If my response helped mark as helpful and accept the solution.