script include delete record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 07:47 PM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 09:57 PM
Still can't delete the record with the same status as abolished by the sytem name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 10:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 10:27 PM
Please share the script and some details of where you are using this script?
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 10:38 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 11:32 PM
Please replace 'table' with the correct table name in Line #54.
Also, "if" with "while".
Muhammad