- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 01:03 AM
Hi,
Is there a way to check the number of returned records using GlideRecord and not GlideAggregate?
I need to query a record, but if the query return more than one result, i need do something else.
I know that i can do GlideAggregate with COUNT, and then do another GlideRecord, but i was wondering if i can do it in one Glide call.
Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 01:25 AM
Hi
Please check using GlideRecord --> GetROWCOUNT Method
var gr = new GlideRecord('incident') gr.query(); gs.info("Records in incident table: " + gr.getRowCount());
Please mark helpful / Correct , If your query is resolved
Rajesh Kumar Annepaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 01:22 AM
Hey,
This is also a way to count.
var count = 0;
var gr = new GlideRecord('change_request'); // write your table name
gr.addQuery('active',true); // write appropriate query
gr.query();
while(gr.next()){
count = count+1;
}
alert("Count is : " +count);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 01:25 AM
Hi
Please check using GlideRecord --> GetROWCOUNT Method
var gr = new GlideRecord('incident') gr.query(); gs.info("Records in incident table: " + gr.getRowCount());
Please mark helpful / Correct , If your query is resolved
Rajesh Kumar Annepaka
