比如,已知一个扩展类型是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(110) Comments(0) Diggs(0) Edit
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(149) Comments(0) Diggs(0) Edit
//有几个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(232) Comments(0) Diggs(0) Edit
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(167) Comments(0) Diggs(0) Edit
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(117) Comments(0) Diggs(0) Edit
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(225) Comments(0) Diggs(0) Edit
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(168) Comments(0) Diggs(0) Edit
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(184) Comments(0) Diggs(0) Edit
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(93) Comments(0) Diggs(0) Edit
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(230) Comments(0) Diggs(0) Edit
怎样用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(234) Comments(0) Diggs(0) Edit
第一步,先在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(200) Comments(0) Diggs(0) Edit
其实我也发现这个问题了,但是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(282) Comments(0) Diggs(0) Edit
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(220) Comments(0) Diggs(0) Edit
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(160) Comments(0) Diggs(0) Edit
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(345) Comments(0) Diggs(0) Edit
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(211) Comments(0) Diggs(0) Edit
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(129) Comments(0) Diggs(0) Edit
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(179) Comments(0) Diggs(0) Edit
方法一,直接修改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(183) Comments(0) Diggs(0) Edit