How to make it visible choices based on class

raj149
Giga Guru

Hello Experts,

I have created ABC field(dropdown field) in cmdb table.

For ABC field i have created 5 choices

1.A

2.B

3.C

4.D

5.E

then i added ABC field on form  in 4 different class example (windows,linux,unix,aix)

Now my requirement is 

In windows form for ABC field i want to display only A choice in dropdown

In Linux form for ABC field i want to display only B choice in dropdown

In Unix form for ABC field i want to display only C and D choice in dropdown 

In AIX form for ABC field i want to display only E choice in dropdown

 

How to achieve this 

 

Thanks in advance 

 

Best regards

Raj

 

 

5 REPLIES 5

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @raj149 ,

 

Create a onload Client Script on cmdb_ci table, in the script section based on the CI class you can use g_form.removeOption() function to remove the options based on the CI class.

 

I hope it helps !

 

 


ā˜‘ļø Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hello @Sohail Khilji 

 

Thanks for your help i am still learner 

Could you please help me with script

 

Best Regards,

Raj.

Breno Abreu
Tera Contributor

Each CI class is a different table.

I think the best is this case is to configure a dedicate choice for each table instead.

 

-
O Abreu

Hello @Breno Abreu 

 

Yes you are correct each CI class is having different tables.

But you can check 80% of fields is created in top level means cmdb_ci table.