need to populate reference field values based on previous select box options

Sateesh11
Tera Contributor

Hi All,

we have two fields (1. Location--->select Box with three values 105 West,33 NYA & Mission Bay)

2. Seating Assignment (Reference Field from custom table(u_seating).

my requirement is, based on select box value, reference field values should be populated)

ex: if i select 105West from select box, reference field should display 1, 2 & 3 only

if i select 33 NYA from select box, reference field should display 11, 12 & 13 only

if i select 105West from select box, reference field should display 21, 2 2& 23 only

 

attached the screen shot for fields & table structure,

 

1 ACCEPTED SOLUTION

@Sateesh11 Your location variable on the catalog item should be of type reference field instead of select box. Once updated the location would be filtered correctly.

 

Also, I am assuming the u_location field on u_seating is a reference field and refers to cmn_location table.

View solution in original post

9 REPLIES 9

@Sateesh11 Your location variable on the catalog item should be of type reference field instead of select box. Once updated the location would be filtered correctly.

 

Also, I am assuming the u_location field on u_seating is a reference field and refers to cmn_location table.

Hi Sandeep,

it is working fine as expected.

i have another question about this requirement, based on location seatings are visible as expected.

1. selected location as 105west from location field-->i can be able to see and select 105west seats

2.selected location as 33 NYA from location field-->i can be able to see 33NYA Seats, but after selecting nothing has come under seating reference field.

 

FYI: 105West seats filed is display true in the table(u_seating).

any suggestions?

 

attached screenshot for your quick reference.

 

 

Mani A
Tera Guru

@Sateesh11 

reference qualifier on seating arrangement field

 

new scriptInclude().checkData(current.u_location);

 

Script include :

 

checkData: function(location) 

var locationID= location;  

 

var gr=new GlideRecord("u_seating");

gr.addQuery("u_location",locationID);

gr.query();

var arr=[];

while(gr.next())

{

arr.push( gr.sys_id.toString());

}

 

 return 'sys_idIN'+arr.join(',');

};

@Sateesh11  have you tried above script with correct fieldnames...

Please accept solution if it is helpful 

Sateesh11
Tera Contributor

Hi Mani,

 

Thanks for your solution, but it is displaying all values, irrespective of location selection.