Advanced reference qualifier not working when I paste or type values on field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 01:15 PM - edited 02-01-2023 01:36 PM
Hi,
I am using an advanced reference qualifier on a reference field that calls a script include:
-> Qualifier: javascript : new ChangeRequestUtils().incidentSource(current);
-> Script Include:
incidentSource: function(current) { //current is a change_request record
if(current.type == 'emergencial' || current.type == 'emergency') {
var sysId = '';
var gr = new GlideRecord('incident');
gr.addEncodedQuery('priorityIN1,2');
gr.query();
while(gr.next()) {
sysId += gr.sys_id + ',';
}
return 'sys_idIN' + sysId;
}
}
When I use the search icon (magnifying glass) on the reference field, the filters that I made on script include works and show the incident filtered results. But when I try to put directly on the field an specific incident value (copy and paste) or type any incident value on the field, it accepts everything (even the incident) record is not part of the specific filter in the include script)
Anyone know what is happening ? Is it possible to filter works also when I fill manually the reference field ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 01:55 AM
I have also noticed this on other reference fields: when searching by pressing the magnifying glass + popup, the reference qualifier is used, but if a valid display name is pasted it is actually accepted, even though the pasted display value/record should have been filtered out by the reference qualifier. Happens on Change records.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 05:15 AM
Did you achieve any way to apply the advanced referece qualifier filters also when paste value on the reference value ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 06:23 AM
No, it is a mystery still.
I'm hoping someone has some idea here 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 08:26 AM
@-O- Maybe an onChange client script that runs every time that the reference field change value ? (Is this case, the script include would be called by the client script to validate if the value entered on the field is a valid value or not)