- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2017 03:30 AM
On our Problem form users can add a new CI if the one they need is not already there. On the form there is an option to select the Class, this is a choice list of type 'System Class Name'. I want to restrict the classes available in this choice list, can anyone advise on how to achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 05:45 AM
g_form.clearOptions() clears all options. You could clear all, then add back only the preferred classes. GlideForm (g form) - ServiceNow Wiki.
Example:
g_form.clearOptions('sys_class_name');
g_form.addOption('sys_class_name', 'cmdb_ci_server', 'Server');
Or, rather than using this client-side code, you could create a custom UI Page that facilitates adding a new CI. You could add your filter in a <g:ui_reference> tag. Extensions to Jelly Syntax - ServiceNow Wiki.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 05:56 AM
Hello,
You may also try Query Business rule on the choice table but you have to be very careful while writing that.
I would suggest you can use g_form.ClearOption or g_form.removeOption or g_form.addOption