- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2017 10:02 PM
Hey Nathan, I have a similar requirement - to display a few field values from the related m2m table on one of the 2 m2m tables. Any idea on how to do that ? I have written this below BR on that m2m table and 'Incident' & 'Train Delay' are the 2 tables that are related via many to many.
This script isn't working....:(
(function executeRule(current, previous /*null when async*/) {
var gr1 = new GlideRecord('u_train_delay');
gr1.addQuery('sys_id',current.u_train_delay);
gr1.query();
if(gr1.next()) {
var inc = new GlideRecord('incident');
inc.addQuery('sys_id',current.u_incident);
inc.query();
if (inc.next()) {
//var state = current.state.getDisplayValue();
//var group = current.assignment_group.getDisplayValue();
gr1.u_incident_state = inc.state.getDisplayValue();
gr1.u_incident_assignment_group = inc.assignment_group.getDisplayValue();
}
}
})(current, previous);