Example 5: Delete a record in an external source

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 1분
  • In this example, we create a script to delete an incident record from the external source.

    (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);