How to get List of possible options on choice variable field?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 06:02 AM
HI,
I have a select box variable and 'remove' some options via a catalog client script on load.
Now I need to be possible to list the remaining "possible" options via a catalog client script.
How to?
Was was hoping it works this way ...
var values = [];
var sel = g_form.getElement('<variablename>');
for (var i=0, n=sel.options.length;i<n;i++) {
gs.info(sel.options[i].value);
}
.. but this seems not to work.Type Error ... "sel is undefined" ...
Any idea?! Thank you!
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 07:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 07:20 AM
Its a scoped catalog item ... maybe this is an issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 07:43 AM
Also works in my PDI.;-(
No Idea what might be wrong here ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 07:52 AM
Just seeing that I tested in PDI via "TEST IT" .. not via the serviceportal. In Serviceportal, I also get an error.
Saying here, that property options could not be read.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 08:03 AM
The methods getControl(), getHelpTextControl(), getElement(), and getFormElement() are deprecated for mobile devices. For information on using GlideForm for mobile, see Mobile Client GlideForm (g_form) Scripting and Migration .