GlideRecord chooseWindow is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 04:38 AM
Hi,
I am trying to use chooseWindow in my GlideRecord and control the retrieve count. It was working 3 months back but now its not working .
Please help to resolve this issue.
Code :
var now_GR = new GlideRecord('incident');
now_GR.orderBy('number');
now_GR.chooseWindow(2, 4);
now_GR.query();
gs.log("count ="+now_GR.getRowCount());
output : Instead of count =2 , i am getting whole record count.
Regards
sagaya
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 04:43 AM
Hi,
You have to pass third parameter as 'true' in your 3rd line like now_GR.chooseWindow(2, 4,true);
Because default value if false.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 04:50 AM
Its is working fine.
Run this and you will get the clarity
var now_GR = new GlideRecord('incident');
now_GR.orderBy('number');
now_GR.chooseWindow(2, 4);
now_GR.query();
while(now_GR.next())
{
gs.print('Number = '+ now_GR.number);
}
gs.log("count ="+now_GR.getRowCount());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 08:11 PM
Hi Anurag,
Do we need to include any user role to use this chooseWindow ? because its working through backend , but not through API call.
backend execution - admin user
API execution - non admin user
Regards
Sagaya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2021 12:18 AM
Role wouldn't matte with GlideRecord, it doesn't check for role.
If you want a role based GR then use GlideREcordSecure instead.