- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 07:03 AM
Hi everyone,
I am new to ServiceNow development and I am struggling with this.
I am trying to modify the change form so that:
- the [category] field lists all active CI classes. the values of this field should come from the CMDB
- the [CI] field should be dependent on the [category] field
My question is:
- Which table stores the CI classes? If, there is none how do I query the list of active CI classes in my CMDB?
- Can you help with the script to accomplish this?
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 10:17 AM
HI,
Yes, determining "if it has records" could lead to false positives in a hierarchical table structure. If your choices are limited (say 15 or less) than manually creating the choice list is your best answer. Using the class name (e.g. cmdb_ci_server) as a value is encouraged in this case.
To get the CI field to filter on that class, just add a reference qualifier to the dictionary entry for that field.
For example:
javascript:'sys_class_name=' + current.category;
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers
CAUTION: Look at using a dictionary override for your specific table (e.g. change_request) instead of changing the one on the form that is associated to task (and hence all other task related tables like incident, problem, sc_request, etc.)
http://wiki.servicenow.com/index.php?title=Dictionary_Overrides

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 09:11 AM
Can you help me understand what you mean by "active" CI classes? I can get you a list of all names of classes that extend from cmdb_ci using the TableUtil script include, and that can be used with a reference qualifier on the CI reference field to filter, but what do you mean by "active?"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 10:10 AM
My CMDB is not using all tables extending the cmdb_ci table but just a few. So by active I mean CI classes, that have existing records (CIs) in the CMDB.
If a CI class does not have CIs recorded in CMDB I do not want it listed.
What if manually I define the list of CI classes as choice items of the category field, and set their values equal to the CI class (table) name? can I use that in a reference qualifier? If so, how?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 10:17 AM
HI,
Yes, determining "if it has records" could lead to false positives in a hierarchical table structure. If your choices are limited (say 15 or less) than manually creating the choice list is your best answer. Using the class name (e.g. cmdb_ci_server) as a value is encouraged in this case.
To get the CI field to filter on that class, just add a reference qualifier to the dictionary entry for that field.
For example:
javascript:'sys_class_name=' + current.category;
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers
CAUTION: Look at using a dictionary override for your specific table (e.g. change_request) instead of changing the one on the form that is associated to task (and hence all other task related tables like incident, problem, sc_request, etc.)
http://wiki.servicenow.com/index.php?title=Dictionary_Overrides
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 01:06 PM
Thanks a lot chuck for your help and for pointing me to the dictionary override article (wonderful feature).
By the way I am a fan.