Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Reference field query filter not applying to autocomplete search in UI Page

pranavmperu
Mega Contributor

I have a custom UI page with a reference field. On this page, I'm using a client script to filter the available options in the reference field based on a selection in another field. The filtering works correctly when I click the magnifying glass to open the lookup list, but the auto-complete search (when I start typing in the field) ignores the filter and shows all available records from the referenced table.

 

Here is the Jelly code I use:

<g:ui_reference name="name" id="id" table="table_name" query="state=Open" completer="AJAXTableCompleter" size="50" />
 

And in the client script, I also tried:

g_form.setReferenceQual('vi_exception', 'active=true^u_state=Open');
 

Problem:

  • When I click the magnifying glass → the query(filter) works

  • But when I type in the auto-complete search bar of the field → it shows items from the table

Question

How can I enforce the qualifier so that it applies to the auto-complete search as well as the magnifier lookup, only for this form?

0 REPLIES 0