Using Reference qualifier, to trigger based on value selected in another dropdown

meher_sanjiv
Kilo Expert

Hi All,

I have two Lookup Select Box fields (drop down), Server Type and C Drive on a Service Catalog form. Both reference to the same table which has type and GB field.

I have set a reference qualifier to set dropdown values for 'C Drive', based on Server Type Selection.

But it doesn't work as expected.

If I select, Server Type as 'Application', it should set the drop down as values 100,200 etc, based on values in the reference table.

If I select, Server Type as 'Database', it should set the drop down as values 150,200 etc, based on values in the reference table.

But the reference qualifier doesn't trigger, when we change the Server Type. It only works, when Server Type is already populated, when I open the order form.

The reason I am using reference qualifier is, I am also using Price to get auto-updated based on 'C Drive selection'.

1 ACCEPTED SOLUTION

johnlampson
Giga Contributor

Hi Sanjiv Meher



I've done this by setting a reference qualifier on the second lookup select box that calls a script include.



EDIT: In the attributes field, you'll put "ref_qual_elements=server_type"



The reference qualifier you'll put on the "C: Drive" variable lookup select box will look like:



javascript:new ScriptIncludeName().CheckServerType().



Presuming your variable for server type is server_type, the script include will look like:



var ScriptIncludeName = Class.create();


ScriptIncludeName.prototype = {


  initialize: function() {


  },



CheckServerType:function(){


  var server_type = current.variables.server_type;


  return 'u_active=true^u_server_type=' + server_type;


  },



  type: 'ScriptIncludeName'



};






Does this help?



John


View solution in original post

7 REPLIES 7

Brilliant. Thanks John. Thanks guys.



Kalaiarasan Pus
Giga Sage

As Victor has pointed out, you will need to add 'ref_qual_elements' attribute to make it work.. Give it a try...


Absolutely right. I've updated my post to reflect that information.