比如,已知一个扩展类型是ProjCategoryId,下面的代码将为你找出所有使用过这个扩展类型的表。static void findTableWithProjCategoryId(Args _args){ xInfo xInfo = new xInfo(); treeNode t = xInfo.rootNode().AOTfindChild("DataDictionary").AOTfindChild("Tables"); treeNode childNode; treeNode fields; treenodeIterator it, itFld; Read More
posted @ 2009-04-26 12:22
Fandy Xie
Views(118)
Comments(0)
Diggs(0)
//有几个Ax开头的class值得我们研究一下,下面就是调用AxSalesTable和AxSalesLine来创建销售单的例子。static void main(Args args){ AxSalesTable axSalesTable; AxSalesLine axSalesLine; ; // 建立销售单头 axSalesTable = new AxSalesTable(); axSalesTable.purchOrderFormNum('CUSTPONUM'); axSalesTable.custAccount('4000'); axSalesTable. Read More
posted @ 2009-04-26 12:21
Fandy Xie
Views(242)
Comments(0)
Diggs(0)
static void CreateMethodOnRunTime(Args _args){ #AOT ; //路径故意复杂一些,主要是让你体会怎么调用不同的控件。 infolog.findNode(#FormsPath + "//fm_ModifySourceCodeOnrunTime//Designs//Design//[Group:Group]//"+ "[Tab:Tab]//[TabPage:TabPage1]//StringEdit:StringEdit//Methods").AOTadd("LookUP"); infolo Read More
posted @ 2009-04-26 12:21
Fandy Xie
Views(156)
Comments(0)
Diggs(0)
static void CreateFieldMethod(Args _args){ #AOT ; infolog.findNode("forms").AOTadd('fm_DynamicForm'); infolog.findNode("forms//fm_DynamicForm").AOTsave(); infolog.findNode("forms//fm_DynamicForm//Designs//Design").AOTadd('[StringEdit:se]'); infolog.findN Read More
posted @ 2009-04-26 12:20
Fandy Xie
Views(127)
Comments(0)
Diggs(0)
static void CreateFieldMethod(Args _args) { TreeNode tn1,tnAddr, methodsNode; MemberFunction memberFunction; str source; ; tn1 = infolog.findNode("//Forms//Address//Data Sources//Address//Fields//AddrRecId"); tnAddr = infolog.findNode( "//Forms//Address" ); methodsNode = tn1.AOTf Read More
posted @ 2009-04-26 12:20
Fandy Xie
Views(171)
Comments(0)
Diggs(0)
static void loopFieldsInTable(Args _args){ dictTable dt; int numberOfFields; int fieldId; int i; ; dt = new dictTable(tableNum(CustTable)); //name of table info(dt.name()); numberOfFields = dt.fieldCnt(); info(int2str(numberOfFields)); for (i = 1; i <= numberOfFields; i++) { fieldId = dt.f... Read More
posted @ 2009-04-26 12:19
Fandy Xie
Views(236)
Comments(0)
Diggs(0)
static void AddExtendedDataTtyp(Args _args){ UtilIdElements uie; XInfo XInfo = new XInfo(); TreeNode TNode; TreeNode DNode; str Extname='MyExt'; str Props = "PROPERTIES/n" + " Name #AXUStr35/n" + " Label #/n" + " HelpText #/n" + " FormHelp #/n&quo Read More
posted @ 2009-04-26 12:18
Fandy Xie
Views(181)
Comments(0)
Diggs(0)
int ret,j,i;DictTable dictTable;DictField DictField;str curFieldName;;dictTable = new DictTable(tableNum(yourTableName));i=dictTable.fieldCnt()-11;//这里系统会包括表的其他11个父类字段,所以减去11for (j=1;j<=i;j++){ DictField=new DictField(dictTable.id(),dictTable.fieldCnt2Id(j)); curFieldName=DictField.name(); if(cur Read More
posted @ 2009-04-26 12:16
Fandy Xie
Views(98)
Comments(0)
Diggs(0)
Args ArgList = new Args(reportStr(My_Report));ReportRun My_Report = new ReportRun (ArgList);;My_Report.design().caption('My Report');My_Report.query().interactive(false);My_Report.query().dataSourceNo(1).range(1).value('AA');//对报表里的数据源传递参数。若无,则可以不要。My_Report.run(); Read More
posted @ 2009-04-26 12:16
Fandy Xie
Views(192)
Comments(0)
Diggs(0)
static void ChangeTableProperties(Args _args){ xInfo xInfo = new xInfo(); treeNode node = xInfo.rootNode().AOTfindChild("Data Dictionary"); treeNode childNode; treenodeIterator nodeIterator; str properties; str tables; str newLable = "Change label"; ; node = node.AOTfindChild(&qu Read More
posted @ 2009-04-26 12:15
Fandy Xie
Views(241)
Comments(0)
Diggs(0)
怎样用winapi查找文件本文传自:http://spaces.msn.com/AxGeek/ 本例中使用到很多Axapta高级技巧,比如函数的嵌套等,值得大家揣摩。例子中使用到的三个函数解释:fileExists(_name) 若存在文件,则返回 true folderExists(_name) 若存在文件夹或文件,则返回true。 pathExists(_name) 若存在文件夹,则返回true; static void FindFile(Args _args){ #File FileName fullFileName(FileName _path, FileName _fileName) Read More
posted @ 2009-04-26 12:14
Fandy Xie
Views(242)
Comments(0)
Diggs(0)
其实我也发现这个问题了,但是Junevoful已经说的很详细了,我就补充两点:1,使用exists join不可以引用第二个表的数据,表示÷这条数据一旦存在于第二个表中,就认为满足条件,但是使用inner join可以引用第二个表的数据,是内关联。2,大家可以使用Axapta本省带的Sql性能监视器来监视Sql语句的执行效率,启动的方法是:下面我就引用一下Junevoful的文章,他说的很详细,也很精彩,谢谢他给我带了这么好的文章!前几天,在做系统优化的时候,居然发现代码当中存在while嵌套循环语句while select table 1{..while select table2 Read More
posted @ 2009-04-26 12:13
Fandy Xie
Views(292)
Comments(0)
Diggs(0)
第一步,先在form的声明的地方声明变量: public class FormRun extends ObjectRun { QueryBuildRange criteriaPosted; }第二步,数据源(datasource)对应的表的ini方法: public void init() { super(); criteriaPosted=this.query().dataSourceName('YouTable').addRange(fieldNum(YouTable,FieldName)); }第三步,数据源的ExecuteQuery方法下 public void exe Read More
posted @ 2009-04-26 12:13
Fandy Xie
Views(212)
Comments(0)
Diggs(0)
public void displayOption(TableName _record, FormRowDisplayOption _options){ int IcBackColor = winapi::RGB2int(255,255,255); int IcTextColor = winapi::RGB2int( 0, 0, 0); int SiBackColor = winapi::RGB2int(255,128,225); int SiTextColor = winapi::RGB2int( 0, 0, 0); int CrBackColor = winapi::RGB2int(255 Read More
posted @ 2009-04-26 12:12
Fandy Xie
Views(228)
Comments(0)
Diggs(0)
1:直接调用函数 str 24 ComName; ; ComName=appl.company().ext();//当前公司ID curUserid();//当前用户iD systemDateget();//当前时间 Time2Str(timenow(),1,2);//时间转换函数 curuserid()//当前用户2,使用Session对象 session xSession; ; xSession=new session(); print xsession.userId();pause; print xsession.interfaceLanguage();pause;3,使用XInfo对象 Read More
posted @ 2009-04-26 12:11
Fandy Xie
Views(164)
Comments(0)
Diggs(0)
static void ExportImageToExcel(Args _args){ container ImaPos; COM comWorksheet; COM comShapes; COM comCells; COM comFont; COM comPageSetup; SysExcelWorksheet sheet; SysExcelApplication excel; SysExcelWorkbooks books; SysExcelWorkbook book; SysExcelWorksheets sheets; SysExcelCells cells; COMVariant v Read More
posted @ 2009-04-26 12:10
Fandy Xie
Views(353)
Comments(0)
Diggs(0)
void clicked(){ #Excel HWND HWND; SysExcelApplication excel; SysExcelWorkbooks books; SysExcelWorkbook book; SysExcelWorksheets sheets; SysExcelWorksheet sheet; SysExcelRange columns; SysExcelRange column; SysExcelCells cells; SysExcelCell cell; SysExcelStyle ExcelStyle; SysExcelFont ExcelFont; SysE Read More
posted @ 2009-04-26 12:09
Fandy Xie
Views(217)
Comments(0)
Diggs(0)
static void FindPrimaryIdx(Args _args){ DictTable dt; DictIndex di; Common cm; IndexID idx; int i, iCnt; FieldID fid; FieldID fids[,10]; int fidsCnt = 0; str s; str sTemp; int _tID=175,_rID=956968;//可以修改或使用参数传递 ; dt = new DictTable(_tid); if (dt) { idx = dt.primaryIndex(); if (idx) { di = dt.indexOb Read More
posted @ 2009-04-26 12:08
Fandy Xie
Views(139)
Comments(0)
Diggs(0)
方法一,直接修改Info类的StartupPost方法,因为我们修改比较复杂,以下我就直接引用junevoful的代码来做范例。void startupPost(){ int counter; int num = 0; int maxSessions = Info::licensedUsersTotal(); xSession session; UserInfo userInfo; UserId currentUserId; ; currentUserId = curuserid(); for(counter = 1; counter < maxSessions;counter++ ) Read More
posted @ 2009-04-26 12:06
Fandy Xie
Views(195)
Comments(0)
Diggs(0)
custtable c1,c2;dicttable d = new dicttable(tablenum(custtable));dictfield f;int i;boolean areTheSame = true;;c1 = custtable::find('4001');c2 = custtable::find('4001');for(i=1;i<=d.fieldCnt();i++){ f = new dictfield(tablenum(custtable),d.fieldCnt2Id(i)); if (f.isSystem()==false) { Read More
posted @ 2009-04-26 12:06
Fandy Xie
Views(185)
Comments(0)
Diggs(0)
把数字小写转换成大写方法一,使用系统提供的函数,但是不满足大陆财务的要求。方法二:使用下面的函数。英文:static str Num2EngStr(real realNum,boolean showNegative=false){ str aa,bb,T1,T2,T3,B,W,CC,a1; int a2,a=0,c=0; int V,M; real tmpReal; boolean IsNegative=false; ; aa='ONE'+strRep(' ',9-strLen('ONE'))+'TWO'+strRep(' Read More
posted @ 2009-04-26 12:04
Fandy Xie
Views(648)
Comments(0)
Diggs(0)
void clicked(){#ExcelHWND HWND;SysExcelApplication excel;SysExcelWorkbooks books;SysExcelWorkbook book;SysExcelWorksheets sheets;SysExcelWorksheet sheet;SysExcelRange columns;SysExcelRange column;SysExcelCells cells;SysExcelCell cell;SysExcelStyle ExcelStyle;SysExcelFont ExcelFont;SysExcelFormatCond Read More
posted @ 2009-04-26 12:02
Fandy Xie
Views(217)
Comments(0)
Diggs(0)
RunOn,顾名思义,就是指Object在那一层上面运行,客户端,还是服务器端?当然,前提是要在三层结构下面。Axapta当中与RunOn有关的,大概在以下这几个地方:相关的Object,如Form, Report, Class等,Class当中的静态方法,以及MenuItem。 Form和Report是不能设置RunOn属性的,Form只能是运行在客户端,而Report则是由MenuItem所决定的,因为它的RunOn属性其实是被设为(Always)Called from的。当然,假如Report不用MenuItem指定激活的话,如直接在AOT当中用右键打开(Open),那就肯定是在客户端生 Read More
posted @ 2009-04-26 11:59
Fandy Xie
Views(197)
Comments(0)
Diggs(0)
方法一,把所有的参数放到一个字符串里,用特殊符号分开,用args().parm() ,传到另一个form,然后再按照规则读出参数。方法二,把参数保存到一个class,用方法 args.parmObject(_objectname); 传递class到另外一个form,然后用 方法 _objectname = element.args().parmObject();得到class;方法三,使用临时表,用方法 args().record(YourTmpTable); 传递临时表; 方法四,作者:MAXFara,原贴:http://www.qiuhao.com/boke.asp?maxfara.sh Read More
posted @ 2009-04-26 11:57
Fandy Xie
Views(269)
Comments(0)
Diggs(0)
比如要在下拉框中显示ItemID,但是只显示ItemGroup='Group1' 且 ItemType='Bom'的物项,那么传统的使用扩展类型的方法就不使用了,因为扩展类型不能动态传递参数(Itemgroup和ITEMTYPE)。方法1,在InventTable里建立一个方法,lookupItemByItemTypeGroup,client static void lookupItemByItemTypeGroup(FormStringControl lookupCtrl,ItemGroupId ItemGroupId,ItemType _ItemTYpe=I Read More
posted @ 2009-04-26 11:55
Fandy Xie
Views(722)
Comments(0)
Diggs(0)
首先解释一下什么是Ax系统中的Label。起初我们的应用程序是为某个特定的国家的客户来编写的,而且这家客户只是在某个国家内进行交易,因此他们的语言是相同和单一的,在这样的前提下我们的应用程序只需要把客户能够理解的语言把系统的提示和界面上的信息显示出来即可。这样子就可以满足使用单一语言的客户了。接下来我们发现更多的特殊的客户需要我们的系统尤其是他们具有很多的跨国子公司,那么肯定在这些子公司中不会完全使用一种语言来***作系统,因此我们的应用程序需要把程序内信息改成相对应的语言给指定的国家的子公司,这样子我们需要把信息按照语言分成很多类然后只要设定一个开关就可以把不同的信息发布给需要那种语言的客户 Read More
posted @ 2009-04-26 10:58
Fandy Xie
Views(375)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号