- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 03:41 PM
Hi,
Is there a way to set the sys id returned from script include in the reference qualifier for a reference variable?
I have a reference variable that refers to sys_user_group table. I'm calling a script include from the reference qualifier of this field as below.
javascript: new XXXutils().getGroups(current.variables.a,current.variables.b,current.variables.c);
The value returned from this is populated in the reference field dropdown, but not set in the field automatically.
I know this could be achieved by a client script, but just checking if there is a way in the reference qualifier itself to set the value in the variable to display it without selecting from the dropdown.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 05:02 PM - edited ‎02-22-2024 05:04 PM
Hi @janindiadoc_1 Reference Qualifiers are used to filter out data and they will not set to field automatically, it will just show under drop down, if you need to set it on field then use Client callable script include and onChange client script to set it on the field.
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 04:54 PM
Yes. It is possible. In the reference qualifier, make sure to use sys_idIN
For ex
javascript:'sys_idIN'+new XXXutils().getGroups(current.variables.a,current.variables.b,current.variables.c);
The script include should return one or more sysid separated by comma
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 05:02 PM - edited ‎02-22-2024 05:04 PM
Hi @janindiadoc_1 Reference Qualifiers are used to filter out data and they will not set to field automatically, it will just show under drop down, if you need to set it on field then use Client callable script include and onChange client script to set it on the field.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 05:05 PM
Hi @janindiadoc_1, The script include will return the data. In case if you are returning just one record and doesn't have the choice 'None' on the variable, it may be possible that the returned record will be displayed as the variable value in the dropdown (as it is the first record / value) but if you are returning the multiple records then only the first record will be show as a choice and not the other records. You may need the client script to set the specific value on to the variable.
Regards,
Sunil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 06:43 PM
No, you will not be able to achieve this by using the Reference qualifier.
And if you are sure that it is going to be just value that you get back from your query, better you can stick to using the Async GlideAjax to fetch the value and populate the field instead of going through the Ref Qual way
Aman Kumar