Get Server Operating System

Phanideepthi
Tera Contributor

Hi,

We are having a select box variable (server os) where there are Windows and Linux option. We also have another variable called Server which is a reference field from cmdb_ci_server table with conditions class is Windows and Linux.

Now once we select a server the server os should populate with Windows if the server Class is Windows else it should populate Linux. Please suggest on this.

 

Thanks

Phani

3 REPLIES 3

ccajohnson
Kilo Sage

You mention variables, is this a catalog request? What is the intention of this feature. Please let us know so we can solution accordingly.

Hi johnson,

 

yes it is a catalog.

Anurag Tripathi
Mega Patron
Mega Patron

Him,

If I understand correctly, when you select the server on reference field, based on that you need to populate the server os dropdown, if so then use this

This is an onchange client script that runs when the value is selected in the reference field.

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    var ref = g_form.getReference('<reference field name>', getServerOS);
    }
function getServerOS(ref) {
        
        g_form.setValue('<dropdown field>', ref.<OS field on Server Table referenced>);
    }

 

Just add the appropriate field names 

 

-Anurag

-Anurag