How to get same output of the script by using OOTB filter conditions of incident Records for cross checking purpose..??

satish samrat
Kilo Contributor

var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.orderBy('number');
inc.chooseWindow(2,10);
inc.query();
while(inc.next()){
  gs.print(inc.number);
}

5 REPLIES 5

govinddas
Tera Expert

Hi Satish Samrat,

Please be aware that setLimit internally calls chooseWindow, However to apply the same in the filter you may need to use some advanced conditions in the URL parameters

I have some references for you to start exploring

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0868974

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0994141

 

Note: setLimit internally calls chooseWindow.  

Please Mark Correct/helpful, if applicable,

 

Thank you,

Govind Das