- 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
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
08-22-2023 07:19 PM
no, that is not possible. Reference Qualifier are defined in the Dictionary on server-side only.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 06:43 AM
Here ya go.
Yes, you can add or modify a script include via advanced ref.qualifer - but in my case the variable set is used on hundereds of items. Adding code to the script include for "one off" uses will quickly turn it into a mass. Much better to have the change local to the catalog item... imo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2024 07:52 PM - edited 06-23-2024 07:54 PM
this article worked for me:
How to modify Reference Qualifiers with Catalog Client Scripts – ServiceNow – ServiceNow Think (word...
and this is the onChange client script: