Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Table events > List page

Get Row Count

Scroll Prev Next More


This function is deprecated. While the existing code keeps working, we recommend switching to SQL Views.


The ListGetRowCount event is executed before the List page is processed. Use this function when your database doesn't support the record count.

You need to use this event together with ListFetchArray and ListQuery events. Read about it in the article How to display data returned by stored procedure.


public XVar ListGetRowCount(dynamic searchObj, dynamic masterTable, dynamic masterKeysReq, dynamic selectedRecords, dynamic pageObject)



an instance of the class which performs search.


a master table name.


an array of keys.


an array of selected records on the Print page, null on the List page.


an object representing the current page. For more information, see RunnerPage class.

Return value

The function returns the number of records or false.

Applies to pages

List, Print.


1. Return a hardcoded number of records:


return 10;


2. Calculate and return the number of records


return DBLookup("select count(*) from test");

See also:

About Database API

Connecting to the database

How to display data returned by stored procedure

List query

About Search API