Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 06:41 PM
Hi,
Try below code and let me know if you still find any error.
var batch = 10;
var final_arr = [];
var gr = new GlideRecord('incident');
gr.addEncodedQuery();
gr.orderBy('sys_created_on'); // Replace sys_created_on with the field you want to sort by
var total_records = gr.getRowCount();
var batches = Math.ceil(total_records/batch);
for (var i = 0; i < batches; i++) {
gr.setLimit(batch);
gr.setOffset(i * batch);
gr.query();
while (gr.next()) {
final_arr.push(gr.number.toString());
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 07:00 PM
geting offset error? @Chaitanya Redd1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 07:23 PM
Can you share error?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 07:26 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2023 07:28 PM
@Chaitanya Redd1 gr.setOffset() is not working