How to populate sub categories based on categories in catalog item variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2019 11:08 PM
Hi All,
I have created a catalog item, in that i have created two reference fields 1. category 2. subcategory. But when i select category all subcategories are showing irrespective of category . i want to show only related subcategories with respect to category . How can i achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2019 11:22 PM
Hi,
As both the fields are reference fields you can do the same using reference qualifiers. Use this post as a reference:
Or you can wrte an OnChange Client Script for the Category field:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if(NewValue == 'value')
g_form.setValue('subcategory','value');
.....//insert required conditions
}
Please mark as correct/helpful if this helps! 🙂
Thanks,
DR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2019 11:24 PM
if both your category and sub category are in same table use the reference qualifier to get this done
for more deatils check the below link.
-satheesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2019 11:46 PM