Table creation in AOT By code in MSD Axapta

 Code To Create a New Table in axapta. Write following code in job and check table in aot after execution of job.


 TreeNode              treenode;  
 AOTTableFieldList       fieldlist;  
 #AOT  
 ;  
 treenode = TreeNode::findNode(#PathOfTable);  
 //PathOfTable =\\Data Dictionary\\Tables\\TestTable\\Fields'  
 treeNode.AoTadd("NameofTable");  
 sqlDataDictionary::Synchronize();  
 treeNode.AoTFindChild(NameofTable);  
 filedlist = treenode::AOTfieldchild(NameofTable).AOTfindchild('Fileds');  
 fieldList.addString('Name');  
 fieldList.addInteger('Address');  
 fieldList.addReal('City');  
 Info(" Table Created");  

By above code new table testTable will be created with Name,Address and city field. You can use this code in your form customization also.