随笔分类 - AX 2009
摘要:As we talk before, AX has no support with sigleton instance modle, but we can use the global cache insteaded.1、Create the global cache.1 SysGlobalCache globalCache;2 ;3 4 globalCache = ClassFactory.globalCache(); //全局缓存,客户端和服务端都可以用,但依赖调用方5 globalCache = Appl.globalCache(); //全局缓存,客户端和服务端都可以用,...
阅读全文
摘要:1 static void dialog(Args _args) 2 { 3 Dialog dialog = new Dialog("Test dialog!"); //标题 4 DialogField dialogField1 = dialog.addField(typeid(ItemId),"Item Name"); //设置字段 5 DialogField dialogField2 = dialog.addField(typeid(noYes),"Update?"); 6 Dial...
阅读全文
摘要:在AX中,我们很容易发现很多子窗口都通过一个“MenuItem”并绑定数据源,就可以完成数据的自动绑定了。其实细节是由“MenuItem”封装好了,我们也可以通过代码实现。 1 static void activateWindow(Args _args) 2 { 3 FormRun fr; 4 Args args = new Args(); 5 CustTable CustTable = CustTable::find("WIB-CHN"); //记录行,如果是母窗口数据源,则实现绑定 6 ; 7 args.name(formstr(Cu...
阅读全文
摘要:1 void ViewCrystalReport() 2 { 3 Com comapp; 4 Com reporting; 5 str paramwhole; 6 str paramfilename; 7 str paramCond; 8 str ViewYesNo; 9 int ret; 10 COMVariant variant; 11 12 ; 13 14 variant = new COMvariant(COMVariantInOut::OUT,COMVariantType::VT_BOOL) ; 15 paramwhole...
阅读全文
摘要:1 void printSummary() 2 { 3 int i; 4 Dimensions m_Dimensions; 5 #avifiles 6 SysOperationProgress simpleProgress = SysOperationProgress::newGeneral(#aviUpdate, "Generating",100); 7 ; 8 9 excel = SysExcelApplication::construct(); ...
阅读全文
摘要:1. Fomat 1. 1 SysExcelStyle style; 2 ; 3 4 ... 5 // Set orientation 6 style.comObject().orientation(90); 7 // distribute text 8 style.horizontalalignment(-4117); 9 // center text 10 style.horizontalalignment(-4108); 11 // right align text 12 style.horizontalalignment(-4152); 13 /...
阅读全文
摘要:Well while working on a current project an associate of mine, partner in crime on the current project named Ed (from Stream Line), shared with me a very nice little trick.You see we had two AOSes that we needed to flush the cache, but could not stop and start the AOSes. The only way I have ever know
阅读全文
摘要:最初的要求是修改ItemId长度变成30,后来运行了一段时间,发现如果不修改ItemRelation和KeyValue的长度,到运行BOM/Route Calculation的时候还是会出问题(上面两个EDT和ItemId没有直接关系)。但终究不能碰到问题才去找哪些EDT遗漏了,于是想到系统自带的修改EDT的form(系统管理==》设置==》系统==》修改数据类型)。其实这个form并不是简单的只修改一个EDT,而是把它的父EDT揪出来,并且找到它整棵EDT树的所有EDT。拿ItemId为例,它整棵EDT树包括ItemIdBase,ItemIdAlternative,ItemIdProduct
阅读全文
摘要:1、生成文件。 1 Args args; 2 ReportRun reportRun; 3 System.Exception ex; 4 str reportname = reportstr(PriceDiscTable_Purch_Expiration); 5 str AttachmentPath = "\\\\xxxx004\\MailAttachment\\PriceDiscTable_Purch_Expiration.PDF"; 6 //通过Batch生成文件要用相对路径的共享文件夹 7 ; 8 9 args = ...
阅读全文
摘要:1 fileName getTempfileName(QVS_VendAttachment _QVS_VendAttachment) 2 { 3 BinData binData; 4 Filename filename; 5 FilePath filePath; 6 #WINAPI 7 str endSlash(str _str) 8 { 9 return (strscan(_str, '\\',strlen(_str),-1)) ? _str : _str + '\\';10 }11 ;1...
阅读全文
摘要:This method must be based on a form, and using in the system enviroment 'windows 2008' may facecompatibility error.void clicked(){ SysExcelApplication Excel; SysExcelWorkbooks Books; SysExcelWorkbook Book; SysExcelWorksheets Sheets; ...
阅读全文
摘要:Way 1: Use 'TextBuffer' to Export CSV from AX. 1 static void ExportToCSVFile01(Args _args) 2 { 3 TextBuffer textBuffer = new TextBuffer(); 4 InventTable inventTable; 5 FileIoPermission perm; 6 counter Lines; 7 8 ...
阅读全文
摘要:1 void showBOMItemImage(ItemId _ItemId, ConfigId _ConfigId) 2 { 3 Image CacheImage; 4 container CacheContainer; 5 real ImageRatio; 6 int AdjustHW; 7 FilePath filePath; 8 BinData BinData; 9 Inve...
阅读全文
摘要:Had a case then I needed to do a modification to a report with a custom dialog where the user could make some changes to the information that teh report would show.I needed the same behavioure as you get from a RunBase class but I needed to use it in a report. Tha solution was to use the xSysLastVal
阅读全文
摘要:Way 1:static void CustAccountRename(Args _args){ CustTable custTable; ; select firstOnly custTable where custTable.AccountNum == '1103'; if (custTable.RecId) { custTable.AccountNum = '1103_'; custTable.renamePrimaryKey(); }}Way 2: 1 void renamePrimaryKey(Common _common) 2 { 3 Comm...
阅读全文
摘要:1 static void LedgerReasonMerge(Args _args) 2 { 3 ReasonTable reasonTableDelete; 4 ReasonTable reasonTable; 5 ; 6 7 ttsBegin; 8 select firstOnly forUpdate reasonTableDelete 9 where reasonTableDelete.Reason == 'COUNTER';10 select firstOnly forUpdate reasonTable11 where reasonTab...
阅读全文
摘要:1 SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(QVS_PriceDiscVendName), _lookupCtrl); 2 Query QE; 3 QueryBuildDataSource DS; 4 ; 5 6 QE = new Query(); 7 DS = QE.addDataSource(tablenum(QVS_PriceDiscVendName)); 8 DS.addRange(fieldnum(QVS_PriceDi...
阅读全文
摘要:有人也许发现AX安装成功后,重新启动系统发现AX的AOS并没成功启动,虽然已设置为“Auto”。这是由于AX依赖MSSQL服务,如果AOS和数据库安装在同一服务器,由于MSSQL服务启动较慢,造成AOS启动失败。我们可以按以下图示进行设置,重复执行,问题解决。
阅读全文
摘要:这个例子来自Google,有点绕,通过类SalesAutoCreate和中间表实现销售订单导入,中间表主要储存销售订单行关键信息。Many projects use an interface to import their sales orders, because of this a SalesAutoCreate class was created. This class is easily extendable and customizable.The first thing to do is designing a buffer table, like this one for.Aft
阅读全文
摘要:在Axapta内通过使用COM 类来构建Excel表,并控制相关单元格的属性设置:如字体的颜色,使用的字体名称,字体大小;以及单元格的边框设置,对齐方式。使用了Axapta系统当中的SysExcel 以及继承自SysExcel的相关子类。COM 类是Axapta封装的一个系统类。对于Excel当中控制单元格对齐,边框等等的具体代码你可以参考VBA的实现。在AX当中用COM对象来实现这些属性设置时的语句与VBA实现基本一致。你比如简单的字体名称,大小设置。Font.name(); Font.size(); 但也有些不太一致。比如在VBA里,添加边框时,你可以控制到单元格的上下左右边框(range
阅读全文

浙公网安备 33010602011771号