How to apply reference qualifier for Data Lookup Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 05:42 AM - edited ‎08-12-2024 05:44 AM
Hello Experts, I have two lookup select box fields in Catalog Item. First one is Country and another one is State. So when I select a country in Country field, then only states of that country should populate in State field using 'cmn_location' table data. To achieve this I have created one Script Include and called it in Reference Qualifier.
When I test this Script Include in Background Script, I'm getting only states of that country.
But when I call it in State lookup field using Reference Qualifier, I'm still getting all states are populated..
And I have attached screenshot for reference.
SS1 :- Variables
SS2 :- Script Include
SS3 :- Calling Script Include using Reference Qualifier

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 08:56 PM
@sidduab17 Instead of returning the state names, you should return the sys_ids of the state records.
Line number 12 should be replaced with
arr.push(gr.getValue('sys_id'));
Line number 14 should be replaced with
return 'sys_idIN'+arr.toString();
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2024 01:40 AM
Hi @sidduab17
Assuming you have two lookup select box variables for Country and State respectively, you need to make use of the below Advanced Reference Qualifier in the State field to populate State based on country :
javascript:"country="+current.variables.country.getDisplayValue(); //Assuming country is the name of the Country variable.
Output :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.