How to filter a g:ui_reference field in relation to another g:ui_reference.

Pascal P
Kilo Guru

Hi, 
I know this question gets asked a lot, and everywhere I see the same answer from Ankur Bawiskar. But I am facing an issue, and was wondering if I'm the only one.

Here is the exact same problem as I have, with the "accepted" answer : https://community.servicenow.com/community?id=community_question&sys_id=0ab747e9db1cdbc01dcaf3231f96...

So, I'm trying to change the query of a g:ui_reference, based on another g:ui_reference in the same UI Page. After following the steps mentionned in the above link, I managed to do what I wanted, and change the filter in the g:ui_reference pop-up page.

Using this code in the client script : 

vendorLookUp.setAttribute('onclick',"mousePositionSave(event); reflistOpen( 'Vendor', 'not', 'u_bpvendors', '', 'false','QUERY:business_partner.active=true','company=" + comp_sys_id + "', '')");

 

And at first glance, everything seems to work, EXCEPT when using the Autocomplete feature. After changing the first g:ui_reference, the autocomplete of the second g:ui_reference is not refreshed, and still shows me the same values as when the page first opened. *This is a major breach in my data integrity.

So, I tried changing other attributes,like the onfocus and the sn-atf-data-type-params, both of them did nothing to change the autocomplete list.

I would be ok with just de-activating the Autocomplete feature altogether, but I don't know how either.

Can anybody help me ?

Thanks ! 

1 ACCEPTED SOLUTION

Hi,

Can you try adding it purposely to false, like so?

completer="false"

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

4 REPLIES 4

Allen Andreas
Administrator
Administrator

Hi,

In the reference, do you see a completer parameter? Like this:

completer="AJAXTableCompleter" columns="department" columns_search="true"

If so, if you remove that, that's how to take that out.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

 

Thanks for the tips, but in my case, I don't have any of these parameters, and still get the autocomplete feature.

<g:ui_reference name="Vendor" id="Vendor" table="u_demo_table" query="business_partner.active=true" onchange=""/>

find_real_file.png

Hi,

Can you try adding it purposely to false, like so?

completer="false"

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen,

Yes indeed it works, thanks.

P.S. I will wait a few days before marking this reply as "Correct". As it is the answer to the workaround, and I would like to see if someone know how to refresh the actual Autocomplete list.