Reference Qualifiers for a Catalog Form

Stergios Stergi
Mega Guru

Hello Team!

 

I need your opinion on a small developing fix I'm trying to implement.

 

I have a Catalog Form that has two Variables that are reference type. 

"Database Instances" Referencing the cmdb_ci_db_instances table

"Database Name" Referencing the cmdb_ci_db_catalog table.

 

I want to implement a reference qualifier on the Database Name variable that will filter the options based on the Database Instance that would be selected.

Example.
Database Instances -> PRD002

Database Name -> List is filtered to only show: CSB, CSB2005, HANGFIRE etc.

That have PRD002 as the database instance.

 

The cmdb_ci_db_catalog table has the database instance field referenced to the cmdb_ci_db_instance.name field.

 

Any help would be really apriciated!

1 ACCEPTED SOLUTION

Anirudh Pathak
Mega Sage

Hi @Stergios Stergi ,

In the "Type Specifications" tab of variable "Database Name" select "Advanced" from "Use Reference Qualifier" field and try the below code -

javascript:'name='+current.variables.VariableNameOfDatabaseInstance

Note:
Replace "name" with the field name of "Database Instances" present on "cmdb_ci_db_catalog" which is referencing to "cmdb_ci_db_instances" table.

Replace "VariableNameOfDatabaseInstance" with the name of the variable "Database Instances" present on catalog item.

View solution in original post

2 REPLIES 2

Anirudh Pathak
Mega Sage

Hi @Stergios Stergi ,

In the "Type Specifications" tab of variable "Database Name" select "Advanced" from "Use Reference Qualifier" field and try the below code -

javascript:'name='+current.variables.VariableNameOfDatabaseInstance

Note:
Replace "name" with the field name of "Database Instances" present on "cmdb_ci_db_catalog" which is referencing to "cmdb_ci_db_instances" table.

Replace "VariableNameOfDatabaseInstance" with the name of the variable "Database Instances" present on catalog item.

Stergios Stergi
Mega Guru

Hi @Anirudh Pathak 
Thank you very much!
The script I used that workedQ

javascript:;'database_instance='+current.variables.database_instance

 

I had to change the&colon to a simple : 

Thanx once more!