
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 05:32 PM
Hi,
Just curios to know if we can gliderecord only 100 records. Below is the sample query, In this query i am querying incidents of last three months and lets say there are some 6000 records. For my requirement i need to query only first 1000 records in the query. How can i get that? Or how can i terminate glide after count reaches 1000.
var count = 0;
var gr = new GlideRecord('incident');
gr.orderByDesc('number');
gr.addEncodedQuery('sys_created_onONLast 3 months@javascript:gs.monthsAgoStart(3)@javascript:gs.endOfThisMonth()');
gr.query();
while(gr.next())
{
count = count+1;
}
gs.log(count);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 05:34 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 05:34 PM
have you tried
- gr.setLimit(1000);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 05:35 PM
No, let me try that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 05:36 PM
thanks , that worked.