Restrict category and subcategories depending on Catalog Item

kaustubh vishnu
Tera Expert

Hi,

For Incident managing, I have 10 categories and respective subcategories.
For Catalog Items(Record Producer to "Raise an Incident") I am using same values of category and subcategory.
But for another Catalog Item(Record Producer to "Raise Security Incident") I want to show only 5 categories and respective subcategories.

I want to restrict values of categories for specific Catalog Item.
I think need to use "catalog client script" but  don't know to how and what should be script.

Please help me to restrict values of categories for specific Catalog Item.

1 ACCEPTED SOLUTION

kaustubh vishnu
Tera Expert

Answer:
Use following code as per requirement:

//g_form.addOption('variable_name''choice value''choice lable');

g_form.clearOptions('category') // is important to clear available set of categories


g_form.addOption('category', 'hardware', 'Hardware'); // to add category option


g_form.removeOption('category', 'Login Issue', 'Login Issue');  // to remove category option

Thanks

-KV

View solution in original post

6 REPLIES 6

Mehta
Kilo Sage
Kilo Sage

You can use onload Catalog Client Script and use g_form.addOption('variable_name', 'choice value', 'choice lable');

 

for example : 

 
g_form.clearOptions('category')
g_form.addOption('category', 'hardware', 'Hardware');
g_form.addOption('category', 'software', 'Software');
 
 
 
 

Thank You for response.
Your answer helped me. Thanks.

Your Welcome, 

Can you mark my answer as helpful.

SumanthDosapati
Mega Sage
Mega Sage

Hi,

Do you want to show only few categories in record producer form or in the created incident?

If in record producer, in the category variable you can add only the required options.

1) In 'Raise an incident' record producer, open the category variable, add the required options in select box 

2) In 'Raise Security Incident' record producer, open the category variable, add the only few required options in select box.

If you are using same variable set for both catalog items, then only you need to go with client script. or else client script isn't needed.

 

Mark as correct and helpful if it solved your query.

Regards,

Sumanth