"Reset" choice box values on catalog item variable - possible?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2019 02:36 AM
Hi,
I'm adding new options depending on other field values. But I need to be able to reset the values back to the "default* options via catalog client script.
One workaround (I thought) would be to fist use g_form.clearOptions('fieldname'); and then manually adding the relevant options again via g_form.addOptions('fieldname', 'default_1'); g_form.addOptions('fieldname', 'default_2'); g_form.addOptions('fieldname', 'default_3'); ... etc.
But somehow this does not work ;-(
Options remain cleared out.
Anyone with a good idea how to solve issue?
Working in scoped environment ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2019 04:48 AM
Hi,
One question:- Does the original values changes depending on the value selected in previous field.
If not then can you try below?
1.add the new option you want.
2.Set the value to the default value of your choice.
Hope this helps!!
Thanks
Harshad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2019 07:13 AM
thnx.
Does not help here.
There are 10 possible options.
In case an other field is set to a specific value, an other option will possible be added via catalog client script.
But when changing this variable back to an other value, the added option is to be removed again.
I can't know the value of the option - so I can dynamically remove it.
And on the catalog item in the service portal I can't set a scratchpad variable .. so best would be to clear all and reload default options.
But if this is not possible I will have to use a helper variable I can use to store the newly added option to be able to remove it again ... not a nice solution ... but last chance I assume ;-/