Server UI Actions using GlideRecord and getRowCount

Impact area

Scalability 

Severity

Medium

Affected element

UI Action

Rule ID

SN-0042

Impact

The GlideRecord.getRowCount() works by getting the whole result set without using the build-in arithmetic functions of the database. GlideAggregate does use the database, therefore is often drastically faster. The exception to this recommendation is if you intend to loop through the records and process them anyway

Remediation

Replace GlideRecord with GlideAggregate and a COUNT aggregate to improve performance. This could make a large impact when working on tables with a high record count.

Time to fix

15 min

What's here


Related content

ServiceNow rules

UI Action rules





Last modified on Jun 9, 2020