how to trigger autofill from a client script

cdgaefke
Kilo Expert

Hello all.   I have a field that I am populating from a client script.   That field is a reference auto complete field.   If I manually type in a value, the auto complete properly works and I get a list of matching entries below the field.   When I populate it from a client script via the DOM (document.getelementById('fieldname').value = ), the value shows up in the field, but the auto complete doesn't trigger.

I'm not able to lookup the sys_id and store that instead, because there will likely be more than one match based on the value being entered.   It's not possible for me to determine which one to pick programmatically and enter the sys_id.

How can I get the auto complete drop down to trigger when entering the value from a client script?

Thanks.

6 REPLIES 6

Hi Charles,



That could be the difference.   I am on Eureka and Safari/Chrome.   However, if it is doing a direct match, that means the AJAXAutoCompleter is firing.   Is it possible the autocompleter believes there is only one possible match and therefore no need for a dropdown?


I thought of that as well and tried it with a userid that has more than one hit.   With one hit, at least when the field loses focus it eventually fills in.   With more than one hit, the field gets an ugly red underline and doesn't go any further.