output is not displaying on Background script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
var gr = new GlideRecord('kb_knowledge');
gr.addQuery('workflow_state', 'draft');
gr.query();
while (gr.next()) {
gr.deleteRecord();
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @neelamallik,
You can add gs.info(gr.getRowCount()); after the query() to check whether any records match your criteria. If the count is 0, there are no draft records to delete, which is why you’re not seeing any output.
If my response helped, please mark it as the accepted solution so others can benefit as well.
Thanks & Regards,
Muhammad Iftikhar
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
