How to return a list of departments using a Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 01:07 AM
I've got a reference field on my Business Application form that gets its entries from the 'cmn_department' table:
I'm trying to create a script include that will return the following:
- Active Platforms (Department Type = Platform)
- Active Children of Platforms where:
- If an active platform has no children with a Department Type of 'Lab' then the child departments should be displayed and selectable.
- If an active platform has any children with a Department Type of 'Lab' then ONLY the child departments with a Department Type of 'Lab' should be displayed and selectable.
I've tried to write a script include that will get the required results. The code in my script include is:
However, what I'm finding is that I'm not getting any results at all. Does anyone what I need to do to get the required results?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 04:46 AM - edited 12-03-2024 04:48 AM
Hi @matthew_hughes,
I hope the code logic and syntax of the Script include is correct. At a first look I found that the syntax of calling the script include is wrong in your SS.
You need to call the a script include as shown below,
javascript: new ScriptIncludeName().LBGfilterDepartmentsAPM(current.department);
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das