Reference field searching

General Add comments
by:

boyblog2
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?
image001

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.
image003
• Create a user preference table_name.autocomplete.contains (leave the user empty to apply it for all users)
image005
All done! Now, in order for this to take effect, you have to log out first. See the example below for the result.

image007

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.

image009
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)

image011

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 (.img[at].img)

3 Responses to “Reference field searching”

  1. Johnny Quinonez Says:

    Great! So nice to have options.

  2. Michael Lombardo Says:

    “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!!!!!!!!

  3. Ed Kester Says:

    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 🙂

Leave a Reply