Limit the number of Records display on Report ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2014 06:58 AM
I have created a report, but on home page its showing the n number of records , but i want it show only the first 5 records.
i have restrict the record form the list layout, but it was applicable to all of the table.
is there any method so we can restrict the number of record to 5 only.
Thanks
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2017 01:12 PM
I am also looking for this same type of report. Need to limit the # of records displayed to 5 only. If this script didn't work then what is the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2017 10:18 PM
Hi Tammy,
The script works with slight tweak, please find below script written on change management to limit report records to 5 entries
Script Include: Name: my_script_include
API Name: global.my_script_include
Client Callable : true
--------------------------------------------------------------------------------------------------------
var my_script_include = Class.create();
my_script_include.prototype = Object.extendsObject(AbstractAjaxProcessor, {
runReport : function()
{
var x=[];
var gr = new GlideRecord("change_request");
gr.addQuery("active", true);
gr.setLimit('5');
gr.query();
while (gr.next()) {
x.push(gr.getValue('number'));
}
return x;
},
type: 'my_script_include'
});
---------------------------------------------------------------------------------------------------------------
Report Condition should be based on the returning parameter, in above case it is Change id (number)
ID is one of javascript: new my_script_include().runReport()
Please hit like or mark helpful !
thanks,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2019 04:55 AM
Old topic, but I'm looking for something like that to.
I'm willing to report the last 5 KB Article from table knowledge ordered by published date. In comon language, I want to display a list of the 5 most recent published article. In SQL this would be done with ending the SQL request with the LIMIT 0,5 parameter.
Unfortunately, I don't find no where in the forums/google any clue how to do this locally. I don't want to use the global list control option.
Any luck here ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2019 08:23 AM
Forgot to mention : GUI based solution, of course.
thanks guys.