Retrieve "chooseWindow" attribute from a GlideRecord object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 06:05 PM
Hello,
I am wondering if there is a way to retrieve "chooseWindow" attribute from a GlideRecord object.
Consider this scenario:
A widget is doing a GlideRecord query to grab some records from a table. It instantiates a gliderecord like this:
var gr = new GlideRecord('customer_contact');
gr.addEncodedQuery('active=true');
gr.chooseWindow(0, 19); // this would mean grab first 20 records
gr.query();
Now, I am able to get the query by running
gr.getEncodedQuery();
Is there any way to retrieve window size from this GlideRecord object as well?
ALTERNATIVELY:
Is there any way to remove the current encoded query from the gliderecord object and add a new one without re-initializing the object. Something like
gr.removeQuery();
gr.addEncodedQuery('active=true^accountISNOTEMPTY');
So far the only way I have found to remove the existing query is
gr.initialize();
But Initializing the gr removes the Window values as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 09:11 PM - edited 06-06-2023 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 09:17 AM
Hi @Manmohan K ,
Thank you for your response.
From what I understand, getRowCount() would only return the number of rows that were requested?
For example:
gr.chooseWindow(0, 19); // should return 20 for gr.getRowCount();
gr.chooseWindow(20, 39); // will also return 20 for gr.getRowCount();
The main issue is to get the "pagination" values being requested by the widget on query.
Please correct me if my understanding is wrong.
Thank you!