Adding CI class reference field to different form

Dotychczas
Mega Guru

Hello experts,

I have an requirement to add CI class field to one form. Basically I want to create functionality so when user chose for example "Window Server" in that field, in another one which is the reference to cmdb_ci table only CIs in that class would be available. I can't manage to do it as type of class field on CI is sys_class_name. How should I approach that? 

Thanks

1 ACCEPTED SOLUTION

Alright 🙂

 

Normally this is pretty straight forward with a Reference Qualifier, but since you are dealing with CI's is a little different. I think it would something like this for a field with a reference to the cmdb_ci table:

 

javascript:"super_class=" + current.<1. field name>

 

Take a look at the documentation here:

https://docs.servicenow.com/bundle/sandiego-platform-administration/page/script/server-scripting/con...

Especially the Advanced Reference Qualifiers Example section is interesting.

Hope it makes sense 🙂

 

-Mark

 

View solution in original post

9 REPLIES 9

Mark Guldhammer
Giga Guru

Hi

So the 2. field should automatically be populated with a reference to the CI, dependent on what is selected in the 1. field? Or do you want to limit the selection in 2. field only to the CI children of 1. field?

-Mark 

Yeah in the 2nd field I want user to be able to chose Configuration Items from the list which have same class as chosen in 1st field.

When user choose Class "a" in 1st field only CIs which shares class "a" should be possible to be chosen in 2nd field.

Alright 🙂

 

Normally this is pretty straight forward with a Reference Qualifier, but since you are dealing with CI's is a little different. I think it would something like this for a field with a reference to the cmdb_ci table:

 

javascript:"super_class=" + current.<1. field name>

 

Take a look at the documentation here:

https://docs.servicenow.com/bundle/sandiego-platform-administration/page/script/server-scripting/con...

Especially the Advanced Reference Qualifiers Example section is interesting.

Hope it makes sense 🙂

 

-Mark

 

Thank you for your answer but I'm stuck on adding class field to this form. I can't add 

current.<1. field name>

I need reference/dropdown field containing all the classes first. Reference qualifier is the next step.