about deleteRecord() method

Mamidi
Giga Contributor

Hi all,

actually when i was trying to delete by using this deleteRecord() it is showing deleted records from all the tables but i only make it for incident so how it affect the remaining ones and another thing is that if i can delete many records at a time by using delete multiple then why to use deleteMultiple()

var gr=new GlideRecord("incident");
gr.addquery("priority",5);
gr.query();
while(gr.next())
{
    gs.info("the record is deleted"+gr.getValue("number"));
gr.deleteRecord();
}

 

Mamidi_0-1766040159860.png

 

 

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

There are out of box business rules to 'cascade' the deletion so that records attached to the deleted record (incident in this case) are not orphaned.  This link has a good description of both

https://www.servicenow.com/community/developer-articles/servicenow-glide-record-deleterecord-vs-dele...