Scoped GlideAggregate - next()

Moves to the next record in the GlideAggregate.

Table 1. Parameters
Name Type Description
none
Table 2. Returns
Type Description
Boolean True if there are more records in the query set; otherwise, false.
var count = new GlideAggregate('incident');
count.addAggregate('COUNT');
count.query();
var incidents = 0;
if (count.next()) {
   incidents = count.getAggregate('COUNT');
   gs.info(incidents);
}