- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 10:37 AM
Hi all.
I'm having trouble with this. What I need to do is with an onchange client script, I have to add a Reference qual condition on a field that references the user table, that will change depending on the user's selection on another field.
Is this possible, to add a reference qualifier condition via Catalog Client Scripts? if so if you could give me an example.
Thanks in advance!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 03:12 PM - edited 10-10-2023 03:16 PM
For future users with a similar requirement, my solution was:
Script Include returns reference qualifier string e.g. "sys_idINx,y,z".
On the reference field, Type Specifications > Use reference qualifier > Advanced.
In the Reference qual field:
javascript: new ScriptIncludeName().FunctionName();
Example:
javascript: new PositionUtils().getPeopleLeaderUsersRefQual();
Note: Replace : with an actual colon. Comment keeps mangling the character.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 10:56 AM
Hi,
What you need is this.
a. Create an onChange client script on the field (Field 1), which will be changed by user's selection.
b. Make a GlideAjax call to a Script include function by passing the changed value of Field 1 to compute the value of Field 2 (user reference).
c. Return the value of Field 2 back to the client script. Use that to set the value in form.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 11:08 AM
This is assuming you want to set a value in Field 2 when Field 1 changes. But if it's about just a reference qualifier change, then you may want to check the approach suggested by Laszlo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 10:56 AM
No, you don't need a catalog client script for that. You need an Advanced Reference Qualifier and a script include, as described here in docs.
You can pass the value of your dependant variable as a parameter to a function in your script include which can do the "math" and return an encoded query string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 06:58 PM
Can you elaborate on
@Laszlo Balla wrote:No, you don't need a catalog client script for that. You need an Advanced Reference Qualifier and a script include, as described here in docs.
You can pass the value of your dependant variable as a parameter to a function in your script include which can do the "math" and return an encoded query string.
I've been trying to achieve setting an advanced qualifier on a reference field based on the input of a previous field, in this case 'manager_requesting'.
I have a script include that returns an encoded query that looks like "sys_idINx,y,z". I tried applying that via client script without success. I tested with applying to the reference qualifier but no luck. Can you clarify the intended syntax for passing a value from a catalog item form in the portal to the script include?
Also can you confirm this will update dynamically if the value of manager_requesting changes while the user is completing the form?