October 2016
Intermediate to advanced
656 pages
13h 42m
English
Earlier in this chapter, the getRowCount function of GlideRecord was introduced. It returns the number of results found. However, this is only determined by getting all the information from the database and then counting it. Wouldn't it be more efficient if we could get just the total number? We can, with GlideAggregate!
The developer site has more information available: https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&type=server&scoped=true&to=class__scoped_glideaggregate__helsink.
Run the following lines of code to get the total number of records that were created yesterday:
var today = new GlideDate(); var yesterdayTime = new GlideDateTime(); yesterdayTime.addDaysUTC(-1); var yesterday = new ...
Read now
Unlock full access