Example 5: Delete a record in an external source
In this example, we create a script to delete an incident record from the external source.
For Remote Table API information, refer to:
(function executeDelete(v_record) {
var gr = new GlideRecord('incident');
if (gr.get(v_record.sys_id)) {
gr.deleteRecord();
} else {
v_record.setLastErrorMessage("Record not found");
}
})(v_record);