一个SDET  
每个人都有梦想

在Axapta中使用 X++代码导入xpo文件可以使用SysImportElements类。使用方法如下:

 1public void importAOT(str fileName)  //fileName为要导入的xpo文件名
 2{
 3   SysImportElements sysImport = new SysImportElements();
 4   ;
 5    
 6   sysImport.newFile(fileName);
 7   sysImport.parmImportAot(true);
 8   sysImport.import();
 9}

10
但是如果要导入的文件已经存在,会弹出对话框。如何避免此对话框弹出。
import方法的默认参数为: #impQueryOverwrite,会查询是否覆盖已有的class或其他对象。只要将其更改参数即可。
sysImport.import(#impIgnoreCheckStatus);
#impIgnoreCheckStatus在"AOT\Macros\AotExport"节点中定义。
posted on 2007-01-29 13:04  Ken_Cui  阅读(279)  评论(0)    收藏  举报