1、系统自带储存过程。 1 exec sp_databases; --查看数据库 2 exec sp_tables; --查看表 3 exec sp_columns student;--查看列 4 exec sp_helpIndex student;--查看索引 5 exec sp_helpConstraint student;--约束 6 exec sp_stored_procedures; 7 exec sp_helptext 'sp_stored_procedures';--查看存储过程创建、定义语句 8 exec sp_rename student, stuInfo;- Read More
posted @ 2012-08-28 14:49 Sprite.z Views(833) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 11:32 Sprite.z Views(248) Comments(0) Diggs(0) Edit
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(); ... Read More
posted @ 2012-08-28 11:30 Sprite.z Views(366) Comments(0) Diggs(0) Edit
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 /... Read More
posted @ 2012-08-28 11:28 Sprite.z Views(1067) Comments(0) Diggs(0) Edit
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 Read More
posted @ 2012-08-28 11:23 Sprite.z Views(200) Comments(0) Diggs(0) Edit
最初的要求是修改ItemId长度变成30,后来运行了一段时间,发现如果不修改ItemRelation和KeyValue的长度,到运行BOM/Route Calculation的时候还是会出问题(上面两个EDT和ItemId没有直接关系)。但终究不能碰到问题才去找哪些EDT遗漏了,于是想到系统自带的修改EDT的form(系统管理==》设置==》系统==》修改数据类型)。其实这个form并不是简单的只修改一个EDT,而是把它的父EDT揪出来,并且找到它整棵EDT树的所有EDT。拿ItemId为例,它整棵EDT树包括ItemIdBase,ItemIdAlternative,ItemIdProduct Read More
posted @ 2012-08-28 11:21 Sprite.z Views(245) Comments(0) Diggs(0) Edit
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 = ... Read More
posted @ 2012-08-28 11:13 Sprite.z Views(376) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 09:52 Sprite.z Views(167) Comments(0) Diggs(0) Edit
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; ... Read More
posted @ 2012-08-28 09:49 Sprite.z Views(667) Comments(0) Diggs(0) Edit
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 ... Read More
posted @ 2012-08-28 09:40 Sprite.z Views(586) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 09:34 Sprite.z Views(189) Comments(0) Diggs(0) Edit
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 Read More
posted @ 2012-08-28 09:30 Sprite.z Views(219) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 09:17 Sprite.z Views(275) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 09:11 Sprite.z Views(152) Comments(0) Diggs(0) Edit
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... Read More
posted @ 2012-08-28 09:08 Sprite.z Views(185) Comments(0) Diggs(0) Edit
有人也许发现AX安装成功后,重新启动系统发现AX的AOS并没成功启动,虽然已设置为“Auto”。这是由于AX依赖MSSQL服务,如果AOS和数据库安装在同一服务器,由于MSSQL服务启动较慢,造成AOS启动失败。我们可以按以下图示进行设置,重复执行,问题解决。 Read More
posted @ 2012-08-28 09:03 Sprite.z Views(266) Comments(0) Diggs(0) Edit
这个例子来自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 Read More
posted @ 2012-08-28 08:56 Sprite.z Views(425) Comments(0) Diggs(0) Edit
在Axapta内通过使用COM 类来构建Excel表,并控制相关单元格的属性设置:如字体的颜色,使用的字体名称,字体大小;以及单元格的边框设置,对齐方式。使用了Axapta系统当中的SysExcel 以及继承自SysExcel的相关子类。COM 类是Axapta封装的一个系统类。对于Excel当中控制单元格对齐,边框等等的具体代码你可以参考VBA的实现。在AX当中用COM对象来实现这些属性设置时的语句与VBA实现基本一致。你比如简单的字体名称,大小设置。Font.name(); Font.size(); 但也有些不太一致。比如在VBA里,添加边框时,你可以控制到单元格的上下左右边框(range Read More
posted @ 2012-08-28 08:36 Sprite.z Views(1170) Comments(0) Diggs(0) Edit
有MVC开发经历的童鞋,可能发现X++由于不支持静态变量是不支持单例模式,Form之间传值只能通过Args类传递。这样程序开发的灵活性就大大受到限制。有人发现,通过系统全局缓存机制来实现单例模式。 1 public static SingletonClass getInstance() 2 { 3 SingletonClass instance; 4 SysGlobalCache globalCache = infolog.objectOnServer() ? appl.globalCache() : infolog.globalCache(); 5 ; 6 7 ... Read More
posted @ 2012-08-28 08:29 Sprite.z Views(309) Comments(0) Diggs(0) Edit