Etiquette

Etiquette




GlideRecord's getRowCount() method pulls in all the records individually and then counts them. As the records in your table grow, this would result in a slower turnaround time. If all you want to do is get the record count, using getRowCount() from GlideAggregate would be a better option. GlideAggregate uses built-in database functionality to calculate the count.

Please note that it is a good practice to use GlideAggregate only if your goal is to get the count. Imagine a case where you also want to do some processing on the records, you can use getRowCount() from GlideRecord in such instances. It wouldn't make sense to use GlideAggregate to get the count and then use GlideRecord to query and process the same records. 










Creative Commons License

Comments