update()
- Use the update() method to save changes to the records in the GlideRecord
- If record does not exist, it is inserted
var incGR = new GlideRecord('incident');
incGR.addQuery('problem_id', '=', 'current.sys_id');
ingGR.query();
while(incGR.next()) {
incGR.work_notes = "Related Problem " + current.number + "closed with the following Close Notes:\n\n" + current.close_notes;
current.close_notes;
incGR.update();
}
In the example shown, the work_notes fields in the returned Incident records are updated with the value currently in the related Problem's close_notes field.