方法一,使用扩展类型 tableName。方法二,使用函数 PickTable(),参考下面的job(可以直接运行)。 1 static void GetSelectedTable(Args _args) 2 { 3 tableid a; 4 ; 5 6 a = pickTable(); 7 print 'Table ID is:'+int2str(a); 8 print 'Table Name is:'+tableID2Name(a); 9 pause;10 } Read More
1 static void ExportImageToExcel(Args _args) 2 { 3 container ImaPos; 4 COM comWorksheet; 5 COM comShapes; 6 COM comCells; 7 COM comFont; 8 COM comPageSetup; 9 SysExcelWorksheet sheet;10 SysExcelApplication excel;11 SysExcelWorkbooks boo... Read More
1 static void FindPrimaryIdx(Args _args) 2 { 3 DictTable dt; 4 DictIndex di; 5 Common cm; 6 IndexID idx; 7 int i, iCnt; 8 FieldID fid; 9 FieldID fids[,10];10 int fidsCnt = 0;11 str ... Read More
1 void startupPost() 2 { 3 int counter; 4 int num = 0; 5 int maxSessions = Info::licensedUsersTotal(); 6 xSession session; 7 UserInfo userInfo; 8 UserId currentUserId; 9 ;10 11 currentUserId = curuserid();12 13 for(counter = 1; ... Read More
1 static str Num2ChnStr(real realNum) 2 { 3 real y; 4 int b, a; 5 str je, x, hz1, hz2, e, h, f, m; 6 boolean IsNegative=false; 7 ; 8 if (realNum == 0) 9 return '零圆';10 if (realNum < 0)11 {12 realNum =... Read More
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(); //全局缓存,客户端和服务端都可以用,... Read More
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... Read More
在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... Read More