Lookup Select Box - how to change depending on another lookup select box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2019 01:25 AM
Hi community,
I have trouble changing options of a lookup select box, and I couldn't find past articles which can help my situation.
Lookup Selection Box A: where users choose item name to order (there are a lot of items to be ordered packed in a service catalog... this may be a cause of this trouble...)
Lookup Selection Box B: where users choose item size, and displayed size option should depend on the option selected in A.
Both options are referenced from the same master table.
However, the query filter seems somehow only work within the table.
Such as, when I set to
type | is | for men
it worked.
However, when I set to
item name | is same as | <value of A>
it didn't.
btw, I first switched to the type to "Reference" instead of "Lookup~" and I set the Reference qualifier condition.
The condition seemed ok, but when I switched to "Lookup~", the reference qualifier said,
item name | is same as | item name (the same field of the same table)
Is there any way to rewrite this reference qualifier or create Client Script to work it just as I want?
I also failed to work with a client script... (see the image & script below, please)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.clearOptions('u_item_size_women');
var choice = new GlideRecord('u_uniform_item_master');
choice.addQuery('u_item_name', newValue);
choice.query();
while(choice.next()){
g_form.addOption('u_item_name',choice.u_item_size);
}
}
Thank you!
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 02:10 AM
Sorry for the late reply. Is the issue resolved? If not, could you share a screenshot of the lookup variable?
From the above info, it looks fine to me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2019 01:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2019 07:39 PM
Thank you Slawek,
Do I need to write also the table name in Reference qual?
Such as;
javascript:'<table name>.<column name>STARTSWITH'+current.variables.<variable set name>.<variable name>;
In my case;
javascript: 'u_uniform_item_master.u_item_name='+current.variables.u_vset_women.u_item_name_women;
It still didn't work...
Do you mind to help me a little more please?