Code to import XPO file to AOT in Microsoft dynamics axapta

Summary:
If you want to  import XPO file to AOT in Microsoft dynamics axapta x++ applications through code then you can write following job in job sections of Axapta

Details

 static void ImportXPOthroughJob(Args _args)  
 {  
 SysImportElements sysImportElmt1 = new SysImportElements();  
 ;  
 sysImportElmt1.newFile("E:\\test.xpo");// This is to assign path of XPO filename  
 sysImportElmt1.parmImportAot(true);  
 sysImportElmt1.parmImportWithIds(false);//This to import without using xpo object ids  
 sysImportElmt1.import();  
 }