How to Manually Close a Bond
(function executeRule(current, previous /*null when async*/) {
var bond;
bond = new GlideRecord('x_snd_eb_bond');
bond.addQuery('document', '=', current.sys_id);
bond.addQuery('state', '!=', 'Closed');
bond.query();
while (bond.next()) {
bond.state = 'Closed';
bond.update();
}
})(current, previous);Was this helpful?
