Related List Based on Record Producer Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 08:21 AM
I need to create a related list where a field on one table contains the same value as a variable associated with a record on another table. Is this even possible?
current.addQuery('first_name', parent.variables.first_name);
Should I perhaps run a GlideRecord query on all records on the table and return only records where the "first_name" variable is the same as current.first_name?
Thanks for any assistance you can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 08:52 AM
Update: I have tried the following script, but it returns zero records:
(function refineQuery(current, parent) {
var sysidlist = "";
var gr = new GlideRecord('x_amtra_passenger_passenger_barring_nomination');
gr.addQuery('variables.subject_first_name', current.first_name);
gr.query();
while (gr.next()) {
sysidlist += gr.sys_id;
}
current.addQuery('sys_id', 'IN', sysidlist);
})(current, parent);