How to apply reference Qualifier for Lookup select box field in Catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 06:08 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 returned.
But when I call it in State lookup field using Reference Qualifier, I'm still getting all states populated..
And I have attached screenshot for reference.
SS1 :- Variables
SS2 :- Script Include
SS3 :- Calling Script Include using Reference Qualifier
Thank You !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 06:36 AM - edited ‎08-12-2024 06:38 AM
Hi @Siddalingesh200 - You don't really need the script include, you can achieve the same with an advanced reference qualifier. You would just need to add conditions to make sure you're not picking up lower-level location types. For example, depending on your data structure, a state's parent may be the country.
javascript:if (current.variables.country != "") "country=" + current.variables.country
Note: The code sample encodes the colon, so make sure you replace ":" with ":"