Need script to delete a record for particular sys_id (xyz) in an incident table?

dyadav
Mega Contributor

Need script to delete a record for specific given sys_id (xyz) in an incident table(for example)?

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,



You can try this code



var gr = new GlideRecord('incident');


gr.addQuery('sys_id', 'your_sys_id');


gr.query();


gr.next();


gr.deleteRecord();



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

6 REPLIES 6

dyadav
Mega Contributor

Thanks everyone, all these method worked for my query .


shantanupad
Tera Contributor

Can we delete the table by using the script