Filter a Lookup select box based on another lookup select box selection

nicolemccray
Tera Expert

I have a script that has worked in the past for filtering a list collector based on the lookup select box selection, but not sure how to modify the script to filter a 'lookup select box' based on another lookup select box:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

   //Type appropriate comment here, and begin script below
    var filterString = "";
 
 //Look for Application
 var pf = g_form.getValue('application');
 
 
 //Concat to filter   u_platform=cba
 if(pf != "") filterString += "^u_platform="+pf;
 else if(pf != "") filterString = "u_platform="+pf ;

 
 var roleCat= 'role_cat';
       window[roleCat + 'g_filter'].reset();
         window[roleCat + 'g_filter'].setQuery(filterString);
         window[roleCat + 'acRequest'](null);
}

 

When user selects the 'application', the second lookup select box should only show those values associated with that application:

First field in the form: application (column name in the table is 'u_platform')

Second field on the form I need to filter: role_cat

 

1 ACCEPTED SOLUTION

Upender Kumar
Mega Sage

Hi,

 

To bind first variable use

find_real_file.png

 

For dependent filed use Reference qual

 

 

find_real_file.png

 

find_real_file.png

 

 

find_real_file.png

View solution in original post

7 REPLIES 7

Upender Kumar
Mega Sage

Hi,

 

To bind first variable use

find_real_file.png

 

For dependent filed use Reference qual

 

 

find_real_file.png

 

find_real_file.png

 

 

find_real_file.png

nicolemccray
Tera Expert

I don't have any experience with Reference Qualifiers.  Can you provide more detail on how to set up?

 

1st variable - application (u_platform in the table)

2nd variable (dependent on selection of the 1st) - role_cat (u_track in the table)

Hi,

I am assuming

1. Table A having columns

         1. Plateform

         2. Track

 

Now as per your scenario 

1. Variable application should have all values of column Plateform

2. Depending on selection of application variable role_cat list should fill.

 

Non on SNC catalog form:

1. Add a variable

find_real_file.png

2. Create 2nd dependent variable

find_real_file.png

 

Hope this will help you.

 

Thanks

The reference qualifier field is not available for a Lookup Select Box.  Do you have to modify a UI Policy to get it to show up?