Show all tables name and Total number of record of AOT in MSD axapta

To Show all tables name and Total number of record of AOT in axapta you can write following code in job . When you run the job you will get all tables with record count in info log.

 #AOT Name TableName;  
   NumberOf TotalRecord;  
   TrNode TrNode;  
   SysDictTable SysDictTab;  
   ;  
   TrNode = TrNode::findNode(#TablesPath);  
   TrNode = TrNode.AOTfirstChild();  
   while (TrNode)  
   {  
     TableName = TrNode.AOTname();  
     SysDictTab = SysDictTable::newTableId(TrNode.applObjectId());  
     TotalRecord = SysDictTab.recordCount(false);  
     if (TotalRecord)  
     info (strfmt("Table Name - Record count", TableName, TotalRecord));  
     TrNode = TrNode.AOTnextSibling();  
   }