Script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:35 PM
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:
Client script:
Issue: I'm unable to get the array of values from the department table. Need help to correct the code.
Thanks,
Nipan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:45 PM
Hi @Nipan1
Change code line number 49 in the script include as below.
departValue.push(gDept.getValue('name'));
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:52 PM
Hi @dgarad,
Thanks for the reply, and yet that was a mistake I did. But still it's not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:48 PM
Hi,
Can you elaborate on what the issue is?
Are you not getting any results at all? What kind of debugging have you done ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:55 PM
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