How does GlideRecordSecure.chooseWindow() method work?

Chakravarti
ServiceNow Employee
ServiceNow Employee

Hi,

How does GlideRecordSecure.chooseWindow(firstRow, lastRow) method work?

var gr = new GlideRecordSecure('incident');
gr.orderBy('number');
gr.chooseWindow(2, 4);
gr.query();
if (gr.next()) {
  gs.info(gr.number + ' is within window');
}

Will it check all ACLs first then returns the rows in range set by chooseWindow() method?

(or) will it first query the rows in the range set by chooseWindow() method and then apply ACLs on them?

I want first behaviour. As per my testing, it is working in other way.

Can someone clarify?

Thanks

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

refer below links for help

Scripts - understanding when ACLs are evaluated

GlideRecordSecure

getRowCount() incorrect when using GlideRecordSecure()

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Chakravarti
ServiceNow Employee
ServiceNow Employee

Thanks for replying.

These links are not mentioning anything about how does chooseWindow() method work.

Regards