When working with references, people might not always know the exact name of the record or item they are looking for. An example of this is a CI.
In this example, when you are searching for your ‘marketing’ business chain, you would have to know that it’s name starts with 01…. right?
There happens to be a trick to allow for easier searching. It is possible to change the search behavior when typing in a reference field from ‘Starts with’ to ‘contains’. This means that instead of having to type 01, you can simply type marketing and your CI will show up in the results beneath the reference field.
To do this, take the following steps:
• Set the glide.ui.ref_ac.startswith property to false.
• Create a user preference table_name.autocomplete.contains (leave the user empty to apply it for all users)
All done! Now, in order for this to take effect, you have to log out first. See the example below for the result.
Now, as you can see in the example above, it is possible to show multiple columns below a reference. Using this same trick, it is possible to search over multiple field when typing in a reference field. See the example below.
In order to search for multiple columns when typing in a reference field, the following attributes must be added to the dictionary entry of the reference field (filled in according to what’s used in the example):
ref_auto_completer=AJAXTableCompleter
ref_ac_columns=sys_class_name;assigned_to, (enter the columns you want to search for)
ref_ac_order_by=sys_class_name, (order by what column)
ref_ac_columns_search=true (search over multiple fields)
Now please be aware that searching over multiple fields is only possible on tables, not on record producers, ui macro’s or ui pages. Unfortunately, the ref_ac_columns_search attribute is not available here.
I hope this blog article is helpful. If you have questions, please let me know via email or a response below!
Good luck!
Kind regards,
Boy den Hartog ([at]
)
December 16th, 2013 at 21:23
Great! So nice to have options.
December 31st, 2013 at 15:44
“Now please be aware that searching over multiple fields is only possible on tables, not on record producers, ui macro’s or ui pages. Unfortunately, the ref_ac_columns_search attribute is not available here.
I hope this blog article is helpful. If you have questions, please let me know via email or a response below!”
THIS APPEARS TO BE FIXED IN DUBLIN!!!!!!!!
March 7th, 2014 at 19:44
Thanks for this. Am still on Berlin and assumed that the autocomplete could be handled solely in the attributes. My autocomplete now functions as desired 🙂