Scoped GlideRecord - getRowCount()

Retrieves the number of rows in the query result.

Note: This method should not be used in a production environment as it creates a heavy load on the system. Instead, use GlideAggregate - Scoped.
Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Number The number of rows.
var gr = new GlideRecord('incident')
gr.query();
gs.info("Records in incident table: " + gr.getRowCount());

Output: