- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 01:17 PM
Hi Experts, I posted a question about filtering the autocompleter list for a reference field on a UI pages but it doesn't seem like that is doable. Now I'm wondering if it's possible to turn off the autocompleter altogether. My code for the reference field is below:
<g:ui_reference class = "beneficiary" name="family_member_1" id="family_member_1" table="hr_beneficiary" completer="AJAXTableCompleter" columns="employee; beneficiary_contact.relationship;" query = "active=true^employee=javascript:gs.getUserID()" onChange="beneficiary_1();" />
The above code works great, but the autocompleter pulls up all beneficiaries instead of just beneficiaries for the logged in user:
In the picture above, when I type in "J", the autocompleter list should only show me Jacak James Lu and Jill Hu since those are my beneficiaries. Since it seems like this cannot be edited, is there a way to turn this feature off completely? Any suggestions would be super helpful, thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 05:15 PM
Hi David,
Try removing active=true from your query or if you have a custom active field on the table, try u_active=true. I have a feeling one of those two scenarios is the case.
Basically errors in queries result in parts of the query being thrown out. I tested g:ui_reference across a couple different tables and a few different scenarios. The one thing I found is that the encoded query will fail silently on you and in very unexpected ways. Basically, any criteria after the "oops" query criteria will be ignored. So here are some examples:
Ref Qual in g:ui_reference ====> Resulting Query
active=true^not_a_field=something ====> active=true
not_a_field=something^active=true ====> no query (all records returned)
active=true^not_a_field=something^numberCONTAINSa ====> active=true
I'll add a note that GlideRecord's addEncodedQuery function does not behave this way and does not return the same results as the g:ui_reference's results. I'm not entirely sure what is going on under the hood of the Reference processor to cause these results, but this is the most likely culprit for your issue as far as I can tell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 05:15 PM
Hi David,
Try removing active=true from your query or if you have a custom active field on the table, try u_active=true. I have a feeling one of those two scenarios is the case.
Basically errors in queries result in parts of the query being thrown out. I tested g:ui_reference across a couple different tables and a few different scenarios. The one thing I found is that the encoded query will fail silently on you and in very unexpected ways. Basically, any criteria after the "oops" query criteria will be ignored. So here are some examples:
Ref Qual in g:ui_reference ====> Resulting Query
active=true^not_a_field=something ====> active=true
not_a_field=something^active=true ====> no query (all records returned)
active=true^not_a_field=something^numberCONTAINSa ====> active=true
I'll add a note that GlideRecord's addEncodedQuery function does not behave this way and does not return the same results as the g:ui_reference's results. I'm not entirely sure what is going on under the hood of the Reference processor to cause these results, but this is the most likely culprit for your issue as far as I can tell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2017 11:08 PM
Removing table="hr_beneficiary" will disable it..