- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 05:58 AM
Hi everyone,
I have a 2 variables on a catalog item:
1. Regulator - which is a reference field on the sys_user table
2. Coordinator - which is a list collector on the sys_user table
My requirement is Regulator could be anyone of the coordinator list.
How to get the list collector value in a reference field?
I tried but not getting the right result - In a reference qualifier condition of the regulator I have put
javascript:"active=true^sys_id="+current.variables.coordinator;
Thanks in advance for any help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:16 AM - edited 04-05-2024 06:58 AM
A list collector field is a comma-separated field when you view the field content using glideRecord.
Keeping above in mind, you will have use:
javascript:"active=true^sys_idIN"+current.variables.coordinator;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:10 AM
Hi @jitusingh
create a catalog client script
Type: onChange()
Target Field: Coordinator
var regulatorField = g_form.getControl('regulator');
// Setting the dynamic reference qualifier
if(regulatorField) {
// newValue here holds the comma-separated sys_ids selected in the List Collector
// Constructing a dynamic query for the reference qualifier
var dynamicQuery = 'sys_idIN' + newValue;
// Apply the dynamic reference qualifier
g_form.getReferenceField('regulator').setAttribute(‘ref_qual_elements’, dynamicQuery);
// You might need to reset the field to enforce the new qualifier
g_form.clearValue('regulator');
}
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:16 AM - edited 04-05-2024 06:58 AM
A list collector field is a comma-separated field when you view the field content using glideRecord.
Keeping above in mind, you will have use:
javascript:"active=true^sys_idIN"+current.variables.coordinator;