Glide record
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 10:39 PM
How to print 5 active incident tickets
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 10:51 PM
var gr = new GlideRecord('incident');
gr.addQuery('active','true');
gr.orderByDesc('sys_created_on');
gr.setLimit(5);
gr.query();
while(gr.next())
{
gs.log("The active records" + gr.number);}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 11:21 PM
Hi @soniya patil ,
Please find the below code to print 5 active records.
var gr=GlideRecord('incident');//Gliding to incident Table
gr.addQuery('active',true);//querying for active records
gr.setLimit(5);//Setting the output limit to 5
gr.query();//Querying
while(gr.next())
{
gs.print('The active incident number is ' + gr.number);// print the active incident
}
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang