- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:03 AM
Hi all,
I have a use case in a record producer form
- there is a requested for field which references the user table
- there is an asset details field which references alm_hardware table
My need is that based on requested for, the asset details variable should only display the assets assigned to the selected user. can someone help me with this.
Advanced ref qualifier for the variable :
javascript: new getGroupMember().assignedAssets(caller_id);
SI:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:24 AM
javascript: 'assigned_to='+current.variables.caller_id
Just add this to the reference qualifier of your asset details
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 02:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:15 AM - edited 06-19-2024 12:20 AM
Hi @abjaffrey
You need to return the encoded query for the reference qualifier and not a list of records.
Also check if you are using the correct name of the application scope, and name of the script include. Add the caller id in the reference qualifier by using 'current.variables.caller_id'.
Kind regards,
Brian
// Reference qualifier
javascript: new global.getGroupMember().assignedAssets(current.variables.caller_id);
// Script include
// Application scope -> global
// Name -> getGroupMember
assignedAssets : function(getUser) {
var abc = new GlideRecord('alm_hardware');
abc.addQuery('assigned_to',getUser);
return abc.getEncodedQuery();
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:49 AM
Hi
thanks for the response but it did'nt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:17 AM - edited 06-19-2024 12:21 AM
Hello @abjaffrey ,
You cannot return array in reference qualifier. it should be records
assets.push(abc.getValue('asset_tag'));
if you're trying to it via client script. Use this in you script, other than that it seems fine.
Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 12:45 AM
Hi
thanks for the response, the output dint work