- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 11:37 PM
I got two fields in catalog item. Article Category and Article Subcategory.
I got Fruit, Alcohol, Electronics categories in the Article Category variables and more like this. In the Article Subcategory there is tens of datas: Orange, TV, Stereo, Beer, Wine, Lemon, Apple etc.. All of the datas of the Article Category and Article Subcategory are in the question choice table.
How can i set that if in the Article Category field I choose Fruit, in the Article Subcategory only those will appear which belong to this category? So apple,orange,lemon etc.. I tried catalog client scripts but it is cumbersome to do this with it. Also in the question choice table there is no field parent-children relation where i could set the 'Fruits' is the parent of the above mentioned records. Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 08:49 AM
I assume you are referring to variables that belong to a Catalog Item, not fields on a table. The best way to approach this is to make your two variables of the type Lookup Select Box. I'll refer to their names in this example as article_category and article_subcategory. The first variable should look like this:
article_subcategory will look similar to this:
Now you just need to go to the sys_choice table and create a record for every category and subcategory value, using sc_req_item for the Table, article_category or article_subcategory for the Element, Label and Value whatever you want, and a Dependent value for the subcategory records. This works without any client scripts due to the ref_qual_elements attribute on the subcategory variable which causes the reference qualifier to be updated when the named variable changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 08:49 AM
I assume you are referring to variables that belong to a Catalog Item, not fields on a table. The best way to approach this is to make your two variables of the type Lookup Select Box. I'll refer to their names in this example as article_category and article_subcategory. The first variable should look like this:
article_subcategory will look similar to this:
Now you just need to go to the sys_choice table and create a record for every category and subcategory value, using sc_req_item for the Table, article_category or article_subcategory for the Element, Label and Value whatever you want, and a Dependent value for the subcategory records. This works without any client scripts due to the ref_qual_elements attribute on the subcategory variable which causes the reference qualifier to be updated when the named variable changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 05:18 AM
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 08:04 AM
You are welcome!