- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 01:18 AM
Hi All,
I need to delete certain records in a table where a particular field has no value.
I have done it for single record using the below code.
var gr = new GlideRecord('table_name');
gr.addQuery('sys_id','07dbd0ea4f005200634df5a18110c75c');
gr.query();
gr.next();
gr.deleteRecord();
How can i fetch multiple records and delete them using Scheduled jobs.
Thanks,
Ramya
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 01:27 AM
var gr = new GlideRecord('table_name');
gr.addNullQuery('fieldName');
gr.deleteMultiple();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 01:27 AM
var gr = new GlideRecord('table_name');
gr.addNullQuery('fieldName');
gr.deleteMultiple();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 01:44 AM
Thanks Srini!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2016 11:29 AM
I am running this script to delete over 300,000 records in a table. It has been running for about 1.5 hours and has only deleted 20,000 records.
Should it be this slow?