Script include

Nipan1
Tera Contributor

Hi All, 

 

I have a requirement to populate a set of value in a lookup select field 'Department' which is getting values from Department table based on the lookup select field 'Business Unit' which is getting values from Business Unit table. 

 

My solution:

1. I wrote an onchange client script to get the Business unit value (getting sys id of the value). 

2. Wrote a script include to first get the name of the Business unit from business_unit table (as I'm getting the sysId from client script) and then try to glide Department table to get the set of values associated with business unit selected by the user. 

 

Script Include:

Nipan1_0-1718000795167.png

Client script:

Nipan1_1-1718000929113.png

 

Issue: I'm unable to get the array of values from the department table. Need help to correct the code. 

 

Thanks,

Nipan

12 REPLIES 12

dgarad
Giga Sage

Hi @Nipan1 

 Change code line number 49 in the script include as below.

departValue.push(gDept.getValue('name'));

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Nipan1
Tera Contributor

Hi @dgarad,

Thanks for the reply, and yet that was a mistake I did. But still it's not working. 

OlaN
Giga Sage
Giga Sage

Hi,

Can you elaborate on what the issue is?
Are you not getting any results at all? What kind of debugging have you done ?

Nipan1
Tera Contributor

Hi @Community Alums,

Thanks for the reply!

I'm not getting the Business unit name, with which the second part of the script include will work and I can get the list of Department values associated with the selected Business unit. 

 

 - Nipan