- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:36 AM - edited 08-06-2024 06:38 AM
I'm trying to validate that when a scipt include is updating incident for example, that values of the choice type fields are valid.
I was hoping I would not have to query sys_choice but I'm facing troubles.
I've tried two approaches so far:
GlideChoiceList -> .getChoiceList
Using this with a table name and field name is almost what I want. But it does not take in to account dependent values.
Element -> getChoices
Again this is very close to what i need, you can even pass a dependent value in. However, it gives you the base table values which is not so useful if new values have been added to an extended table.
Is my only option querying sys_choice. I suppose I've got a query to be quite specfic by this point but I would still rather not make a query.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 07:28 AM - edited 08-06-2024 07:29 AM
var cgl = new GlideChoiceListGenerator(table, field, 'dependentValue');
var choiceListObj = cgl.get();
Seems to give me what i want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 07:28 AM - edited 08-06-2024 07:29 AM
var cgl = new GlideChoiceListGenerator(table, field, 'dependentValue');
var choiceListObj = cgl.get();
Seems to give me what i want.