Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

modifying sys_class_name choices

Dubz
Mega Sage

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?

find_real_file.png

1 ACCEPTED SOLUTION

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.


View solution in original post

5 REPLIES 5

K10
Kilo Guru

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