- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 05:55 AM
Hello,
I have a requirement where the catalog item has 2 fields, A and B ( both of type reference), I want to build an onChange script where when a user select a value in A, field B should only populate values that are in relationship with choice in field A.
How do I achieve this? My code is currently failing.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 06:22 AM
Hi Leandre,
I too had a similar requirement, in which I had to select the Manager in 1 reference field, and his (selected manager's) related members only needed to be shown in other Reference Field.
For this, I made use of Reference Qualifier and called them in Script include.
For Manager reference field, I used Advanced reference qualifier, in Reference qualifier javascript:getManager()
Its Script include is as per the screenshot:
Similarly, to get members, used Advanced Reference Qualifier, in Reference qualifier javascript:getMember()
Members Script include is as per the screenshot:
It worked fine for me.
Please mark my answer as Correct or Helpful, if in case it resolved your query.
Regards,
Vishrut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 06:25 AM
Ideally you should do this with a glideajax call to on the client script to a script include. it can be done with a query or populating a scratchpad, but isn't best practice and you could end up slowing your instance down depending on what tables, and data you need.
what are your reference fields and tables you are querying.