Limit the amount of records returned to 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2015 08:32 AM
I am using the related list incident by same caller and I would like to limit the amount of records returned to 10. This is the script I am trying to use. But it is not limiting the returned records to 10.
Any help is very much appreciated. Thank You.
var gr = new GlideRecord('incident');
current.addQuery('caller_id', Parent.caller_id);
gr.orderByDesc('sys_created_on');
gr.serLimit(10);
gr.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2015 09:21 AM
var gr = new GlideRecord('incident');
gr.addQuery('caller_id', current.parent.caller_id);
gr.orderByDesc('sys_created_on');
gr.setLimit(10);
gr.query();
Try with above code corrected in bold letters

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2016 04:10 PM
Hi David,
Please refer section 10.5 for reference.
http://wiki.servicenow.com/index.php?title=GlideRecord#setLimit&gsc.tab=0