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

Still can't delete the record with the same status as abolished by the sytem name

 

Still can't delete the record with the same status as abolished by the sytem name

 

find_real_file.png

Please share the script and some details of where you are using this script?

Regards,
Muhammad

Please replace 'table' with the correct table name in Line #54. 

Also, "if" with "while". 

 

 

Regards,
Muhammad