Help with adding and removing choice options Service Catalog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 08:10 AM
Hi guys,
I'm working on a catalog form(service portal view) and I've added a select box with a few options. I want to populate a dynamic choice list based on the select box. I have two fields both select box; Department and Department code. Based on Department selected I want to populate a list of choices on the Department code field. I used an On-change client script to addOption, but that displays an undefined error in the task. So, I manually created all the choice options on the field and then added removeOption in the client script. Now, I can see all the choice options regardless of the Department selected. Please suggest the best way to do this. An urgent need. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 08:53 AM
Please share your script and a screen shot of the entire Catalog Client Script.
You would need to get the value (var myVar1 = g_form.getValue('variable_name'); ) and then remove based on the value of that variable (if myVar1 != whatever { g_form.removeOption('variable_name2', 'choice_value';). Make sure you use the Choice value, and not its display value.