Count total number of records of query in MSD axapta through code


Count total number of records of query in axapta through code

to count record from first datasources  write code in following manner.
SysQuery::countTotal(queryRun)

to count records from all attached table to query wrtie following code.
SysQuery::countLoops(queryRun)