script include delete record

kack l
Tera Expert

I want to delete the records in the table whose system name is the same as the status of abolished,

Executed when the next record is created。Urgently need your help

 

 

 

 var CommonInfo_Grr = new GlideRecord('table');
        //CommonInfo_Grr.initialize();
        CommonInfo_Grr.addQuery("status", "abolished");
        CommonInfo_Grr.addQuery("system_name",current.getValue("system_name"));
        CommonInfo_Grr.query();
        while(CommonInfo_Grr.next()) {
           CommonInfo_Grr.addQuery("status", "abolished");
            CommonInfo_Grr.deleteMultiple();
        }

15 REPLIES 15

Hello @kack l 

Please share the updates on this if you are able to achieve what you want or still you are not able to delete the records. If you are still facing the issue then please put the screenshot highlighting the records you want to keep in table and the one you want to delete. It will help to understand your requirement.

Thanks