Categories and SubCategories - Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 01:40 PM
Hello,
So I am having a hard time coming up with this. This is what I need on a Catalog Item.
Categories:
- Europe
- South America
Subcategories: (for Europe)
- England
- France
Subcategories: (for South America)
- Chile
- Ecuador
The subcategories have a dependent value from the categories.
So, I created a UI policy and the script to populate the subcategories depending on the Categories.
--------------------------------
function onCondition() {
g_form.addOption("u_subcategory", "chile", "Chile");
g_form.addOption("u_subcategory", "ecuador", "Ecuador");
}
--------------------------------
It worked, but I have to create 12 similar catalog items, and if my manager decides to add more subcategories, I will have to make the changes to each catalog item!!!! Is there an easy way to pull the subcategories? and if a new subcategory is added to the Subcategories Column, will it automatically affect all the Catalog items?
My friend told me to use a Variable Set, but the problem with that is... for some strange reason I cannot use the Default Value option.
Some of the catalog forms I will create will be automatically populated as soon as the user clicks on them.
Example:
We have a catalog form name ECUADOR.
When the user clicks the Buttom (form) ECUADOR, the form will open up with the category as SOUTH AMERICA, and Subcategory as ECUADOR.
I hope someone can help me.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 01:08 AM
Hi @AngelP83
there is one simple way also, try if it will be possible.
Create one table in which it store subcategory, category, catalog item table name and catalog item. Create one client script using glideajax and call script include to set subcategory value as per category.
For new table everytime you don't need to add columns, changes in Ui policy of every catalog item. You just add columns in new table.
Please check and let me know if any help required on my end.