AXAPTA开发心得v_第1页
AXAPTA开发心得v_第2页
AXAPTA开发心得v_第3页
AXAPTA开发心得v_第4页
AXAPTA开发心得v_第5页
已阅读5页,还剩54页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 nAXAPTA开发心得NAME:2005-11-11AxaptaAxapta支持的平台及支持的平台及DBDBSupported platforms and databasesSupported platforms and databasesBelow is a list of supported platforms and databases for Microsoft Axapta 3.0ClientsApplication ServerDatabasesWindows 98Windows NT4Oracle 9iWindows NT4Windows 2000 ServerMicrosof

2、t SQL Server 2000Windows 2000Windows 2000 Advanced ServerWindows XPWindows XP ServerWindows XP Advanced ServerThe following will be de-supported with Microsoft Axapta version 3.0 (changes from Axapta 2.5 to Axapta 3.0):ClientsApplication ServerDatabasesWindows 95Oracle 8.0.x + 8.1.xWindows MEMicroso

3、ft SQL Server 7.0Axapta3.0支持的国家及语言国家Australia(澳大利亚)Austria(奥地利)Belgium(比利时)Denmark(丹麦)Finland(芬兰)France(法国)Germany(德国)Italy(意大利)Netherlands(荷兰)Norway(挪威)Spain(西班牙)Sweden(瑞典)Switzerland(瑞士)United Kingdom(英国)U.S.A.(美国)语言语言代码语言代码Danish(丹麦语)daGerman (Standard)(德语标准)deGerman (Austria)(德语奥地利)de-atGerman (

4、Switzerland)(德语瑞士)de-chEnglish (Australia)(英语澳大利亚)en-auEnglish (Great Britain)(英语英国)en-gb(此语言作中文用)English (United States)(英美美国)en-usSpanish (Traditional)(西班牙传统)esFinnish(芬兰)fiFrench (Standard)(法语标准)frItalian (Standard)(意大利标准)itDutch (Standard)(荷兰标准)nlDutch (Belgium)(荷兰语比利时)nl-beNorwegian (Bokmal)(挪威

5、)noNorwegian (Nynorsk)(挪威)Swedish(瑞典语)svAXAPTA 推荐的命名规则wNaming conventions (命名规则命名规则)Naming conventions contribute to consistency and to making the application easier to understand. The general Axapta naming conventions that apply to all application objects are described below.(命名规则是为了规范及使程序容易理解.在下面所

6、描述的规则是应用于Axapta的所有应用程序对象的.)For specific naming standards of the various application objects, see their specific topics.(对于不同应用对象的特殊的命名标准,看他们各自的特殊说明主题.)wGeneral rules(一般规则一般规则)All names must be in US English.(所有的名字都所有的名字都应该是美式英文应该是美式英文)Names in the AOT and in X+ code must correspond to the names in t

7、he US user interface.(名字在名字在AOT和在和在X+代码里必须符合美代码里必须符合美式用户的界面式用户的界面.)Names must be logical and descriptive.The default rule is to name logically and descriptively, so if no other specialized rule apply; name logically and descriptively. ()Names must be spelled correctly.(名字必须拼写正确.)If a logical name ha

8、s been given and used in a special meaning, make sure the same logical name is used on every occasion where a name has the same meaning.()Names must be used consistently.All texts that appear in the user interface must be defined using a label. (This rule applies only if you want your solution certi

9、fied as an international solution.)Each paths in the Application Object Tree must be unique. This means that nodes with identical names must not exist.wUpper or lower case (大小写规则)The name of an application object is given in mixed case with an uppercase first letter and the first letter of each inte

10、rnal word capitalized.(一个应用程序对象的名字是大小写混写的单词即第一个是大写字符和每个单词的首字都是大写.)The name of a member (a method, a variable or a table field) is given in mixed case with a lowercase first letter and the first letter of each internal word capitalized.(对于 “Method,Variable or Table field”也是大小写混写:以第一个小写字母开头.和每个内部单词的首字

11、大写的规则.)System functions are treated as other methods, that is, a lower case first letter.(系统函数也被加工成像其它方法一样,是一个小写字母开头.)The name of a primitive type is given in lowercase. Examples: str, date, int, real, void, boolean.true, false, null.(基本类型是以小写字母来书写的.如: str, date, int, real, void, boolean.true, false

12、, null)Reserved words in the X+ language are treated as other methods. Examples: if, while, for, select, ttsCommit. (The reserved words are listed below the System Documentation node in the Application Object Tree.)(保留字也应该一样第一个字母是小写加上其内部单词以大写字母书写,如if, while, for, select, ttsCommit)wAbbreviations(缩写规

13、则缩写规则)Use whole words. Avoid abbreviations unless the abbreviation is much more widely used than the long form, such as URL or HTML.(避免使用整个单词作缩写,除非这样的缩写是非常广泛使用的.如URL or HTML.)If you need an abbreviation, you must comply to the rules stated below.(如果你需要使用缩写,你必需遵守以下声明的规则)w Consistency: if you apply an

14、 abbreviation, this abbreviation should be used everywhere in place of the name, and there should be no more than one abbreviation for a name.w Recognition: the abbreviation should be commonly recognized and understood (at least by Axapta users).wPrefixes(前缀前缀)A business area specific application ob

15、ject is prefixed with the name of the business area the object belongs to, for example Cust*, Invent*, Ledger*, Proj*, Vend*.wThe “DEL_” prefix (DEL_前缀):wName structureWhere possible, application object names should be constructed hierarchically from three basic components:w business area name + bus

16、iness area description + action performed (for classes) or type of contents (for tables)wUnderscore (下画线)The underscore character (_) can be used in the following situations: w When naming formal parameters, it should be used as the first character. (形参的第一个字符应该是一个下画线.)w In the DEL_ prefix.w A sub cl

17、ass can be named as its super class post fixed with the underscore character and a logical name describing the sub class specialization, if the name of the super class has to be shortened (basically to keep the name within the IndentifierName limitation (p.t. str 40 ). The underscore here acts as th

18、e period you normally apply after an abbreviated name.wDo not use underscore(不要使用下画线的地方)in the beginning of application object names(在应用对象名字的开头)as the first character of variable names in class declarations or methods (在类或者是方法内的变量名的第一个字符.) at the end of variable names in class declarations or method

19、s(在类或者是方法的最后一个字符.)wParametersThe names of the formal parameters in methods must be prefixed with an underscore(在方法中的形参的第一个字必须是下画线.)wZero or one space before the parenthesis?Use no space before the starting parenthesis in method declarations and calls.(在方法的定义时括号前不加空格.)Use not space between a methods

20、name and and the argument parenthesis.(在方法名字和变量名之内部不加入空格.)Use one space between if, switch, for, while and the expressions starting parenthesis.(对于 if, switch, for, while这些语法和其后面的括号之间要加入一个空格.)The Nine Steps of Application Development(创建应用程序的九个步骤) Conceptualization: understand the problem.(概念化:理解问题,即

21、撑握需求.)Create Extended Data Types based on the primitive data types and Base Enums.(基于原始的扩展类型或枚举类型创建扩展类型.)Create tables to hold your data.(创建表来存放数据.)Create classes for handling business procedures.(创建处理业务逻辑的类.)Create forms for interacting with the user.(创建用于交互的窗体.)Create reports to extract informatio

22、n and present surveys.(创建报表用于筛选数据和预测.)Create menus and menu items for accessing the functionality in your application.(创访问程序的建菜单和菜单项)Setup system security.(设置系统安全.)Write help information.(写帮助文档.)创建一个FORM在一个类里static void main(Args args) PWS_ExportQuery _PWS_ExportQuery; args preargs,frmargs; Object f

23、ormRun; ; preargs = new args(formstr(PWS_GoldenTaxQuery);/应该要有设计 PWS_GoldenTaxQuery的FORM。 preargs.caller();/呼叫这个FORM。 formRun = classFactory.formRunClass(preargs);/再将呼叫完的FORM赋给FORMRUN。 formRun.init();/执行FORM 的操作。 formRun.run(); formRun.wait(); frmargs = new args(formstr(PWS_GoldenTax); frmargs.calle

24、r(); formRun = classFactory.formRunClass(frmargs); formRun.init(); formRun.run(); formRun.wait();打开一个FORM时所执行方法的顺序wThe new constructor on the form is activated.wThe init method on the form is activated.wThe init method on the form data source is activated.wThe run method on the form is activated.wTh

25、e executeQuery method on the form data source is activated.wThe firstField method on the form is activated. 关闭一个FORM所执行方法的顺序w当按Cancel关闭时的执行顺序:The closeCancel method on the form is activated.The canClose method on the form is activated.The close method on the form is activated.w当按关闭按钮或者是OK按钮时执行顺序如果是按

26、OK按钮关闭窗口则closeOK 会被运行,但如果是按关闭按钮closeOK 这个方法则不会执行.The canClose method on the form is executed The leave control sequence is executed.wThe leave method on the control is executed.wThe validate method on the control is executed.wThe validate method on the data source is executed.wThe validateField meth

27、od on the table is executed.wThe modified method on the control is executed.wThe modified method on the data source is executed. The leave record sequence is executed, if an actual database record is in fact exited.wThe validateWrite method on the data source is executed.wThe write method on the dat

28、a source is executed.wThe insert (if it is a new record), or the update (if it is an existing record) method on the table is executed. The close method on the form is executed. 离开一个控件时的方法执行顺序wThe leave method on the control is executed.wThe validate method on the control is executed.wThe validate me

29、thod on the data source is executed.wThe validateField method on the table is executed.wThe modified method on the control is executed.wThe modified method on the data source is executed. 离开一条记录时的方法执行顺序wThe validateWrite method on the data source is executed.wThe write method on the data source is e

30、xecuted.wThe insert (if it is a new record), or the update (if it is an existing record) method on the table is executed. 创建一条记录时的方法执行顺序wcreate on the data source is executed.winitValue on the data source is executed.winitValue on the table is executed.删除一条记录时的方法执行顺序wdelete on the data source is exe

31、cuted.wvalidateDelete on the data source is executed. If validateDelete returns true .wvalidateDelete on the table is executed. If validateDelete returns true.wThe record is then re-read from the database by the kernel. Unless the record is deleted or updated by another user, then. wdelete on the ta

32、ble is executed. 自动行编号的新增首先自动行编号的新增这需要TABLE和FORM结合才能做到.对于FORM将相应的表作为数据源拉进来,在数据源的CounterField属性选上要自动编号的字段.在TABLE上需要对那个想做自动行编号的字段做索引文件.下面举例:自动行编号的字段添加数据源重载方法.对于FORM的里的数据源的Create方法进行重载,重载成如下:改写上面的东西就可以了.public void create(boolean _append = True) super(_append);同一表的多条从记录显示在一个窗体的不同位置的做法欲达到的效果如下:如上红色框所示物料

33、档窗体“数量”页签的 “采购订单”,“库存”,“销售订单”三组的资料是同一个表,但却是三条不同的记录。只是这三条记录都是跟主表有关联的。例子:My_InventTable(最后的效果)这三个数据源是对应同一个表的,这里以InventTableModule,这个表作例子.这是窗体的主数据源数据源的属性设置:对于这三个从数据源的属性除名字其设置是一样的.数据源名称.真正表名索引可不加,但加了可以提速在这个方法里要定义一些QueryBuildRange.因为这里有三个相同的数据源,所以要定义三个.详见下.这里是要关联的主表.及联接类型.这两个属性也设为一致.对于Purch,Invent,Sales三

34、个数据源,都要有一Init的方法.来初始化不一样的资料,因为这些数据是在同一张表里,但是显示的信息是因不同位置而不同的.void init() super(); criteriaPurch = this.query().dataSourceName(Purch).addRange(FieldNum(InventTableModule,ModuleType); criteriaPurch.value(queryValue(ModuleInventPurchSales:Purch);/这里是上面范围的值. criteriaPurch.status(RangeStatus:HIDDEN); this

35、.query().dataSourceName(Purch).addSortindex(indexNum(InventTableModule,ItemModuleIdx);this.query().dataSourceName(Purch).indexIsHint(true);/上面这两句是指定索引,用以加速.下面是Purch这个数据源的Init的方法.只要对三个数据源进行同样的操作就可以了.在数据源中选择多条记录的处理 wExamplewOn a form with a data source named xRefReferences, the following could be foun

36、d:wvoid clicked() ww xRefReferences xRefReferencesEdit;w w / are there any marked records -w for (xRefReferencesEdit = xRefReferences_ds.getFirst(1) ?w w xRefReferences_ds.getFirst(1) : /if yes, get the first marked recordw xRefReferences; /else, use the current recordw w / continue as long as there

37、 are records to work onw xRefReferencesEdit; w w / get the potential next marked recordw xRefReferencesEdit = xRefReferences_ds.getNext()w w / do processing with xRefReferencesEditw . w w创建一个Number sequence w创建一个Number sequence 所需要用到的对象:新建一个要捆绑Number sequence 的扩展数据类型.将要产生自动编号的表的主字段的扩展类型设为与Number seq

38、uence 捆绑的扩展数据类型.在那个表所属的模块的Number sequence 类(如:NumberSeqReference_MyModule)中新增设置Number sequence 的加载模块.在所属模块的参数表里加入NumberSeqReference的方法.进入到相应模块的参数FORM里NumberSeqReference编号组设上去就可以了.w新建一个要捆绑Number sequence 的扩展数据类型.与创建普通的扩展数据类型一样.以my_prodId(type:str20)w将要产生自动编号的表的主字段的扩展类型设为与Number sequence 捆绑的扩展数据类型.创建一

39、个my_Table的表.有一个字段:ID(扩展类型为:my_Id)在这个表的initVaule方法里w在那个表所属的模块的Number sequence 类(如:NumberSeqReference_MyModule)中新增设置Number sequence 的加载模块.进入到相应模块的参数FORM里NumberSeqReference编号组设上去就可以了.将代码从一个层移到另一个层中:w(1).以要被移动的那一层登录到AXAPTA中.w(2).将要移动的代码用(Export)导出,并将相应的数据表的内容导出来.备份用.w(3).将要移动的代码删除.并同步相应的表w(4).退出AXAPTAw(

40、5).以要移入的层登录AXAPTA.w(6).将在第2步所导出的代码导入.同步相关的数据表;并将相应的数据导入.将一个表从一个层移至另一个中并保留数据w(1).以要被移动的层登录到AXAPTAw(2).将表的数据导出(以二进制形式导出)w(3).将要移动的表的代码导出.w(4).将要移动的表删除.w(5).退出AXAPTA.w(6).再以你移动的层登录到AXAPTA.w(7).将在第3步中导出的代码导进来,并同步表.w(8).将第2步导出的数据导入进来.Use debugger shortcut keys使用使用调试器的快捷键调试器的快捷键When you want to.When you w

41、ant to.PressPressGo to a specified page or line(跳到特殊行)CTRL+GEnable or disable a breakpoint(使断点有效或失效)CTRL+F9Remove all breakpoints(删除所有的断点)CTRL+SHIFT+F9Toggle exploded or unexploded source(查找)F3Run the debugger(执行)F5Set or delete a breakpoint(设置或删除断点)F9Show breakpoint table(显示有设断点的代码)SHIFT+F9Step int

42、o(单步执行会进入内部代码)F8Step over(单步执行,但跳过部代码)SHIFT+F8Step return(执行到光标处)CTRL+F8Open or close the variables window(打开或关闭DEBUGER的变量监视器)ALT+2Open or close call stack window(打开或关闭DEBUGER的堆栈监视器)ALT+3Open or close system variable window(打开或关闭DEBUGER的系统变量监视器)ALT+4Stop Debugging(停止调试)SHIFT+F5Switch line numbers on

43、/offF4fundamental classes(基本类)wSessionwApplicationwCompanywSitewInfowClassFactorywGlobalfundamental classes(基本类)SessionwApplicationwCompanywSitewInfowClassFactorywGlobalSessionwUse Session to get information about the current session.(用Session可以获得当前的会话.)wThe Session methods fall into these categorie

44、s:Client informationLogin timewThe sessionId() and the Session class give unique information on a user.wAlso, use global.isSessionActive().wWhere to use the Session classwUse the Session class to get unique identification of the current session, or information about the client. fundamental classes(基

45、本类)SessionApplicationwCompanywSitewInfowClassFactorywGlobalApplicationwThe Application methods fall into these categories:(Application 有被分成如下的一些分类:)Database log w logDeletew logInsertw logUpdate Number sequence controlw resetNumberSeqAutoAbort w numberSeqAutoClean TTS control User log w updateUserLo

46、g:记录用户的日记,是在startup方法里调用的.Startup method :这个方法是AX在启动时第一个被调用的.用来初始化一些变量. startupCommand这个参数传递的是从AX配置框里startupCommand 框里填入的.有几种参数:w SetBuildNo, UpdateBuildNo, Synchronize, Batch, compileAll, Exit, AOTImport, ApplUpgradeEdit方法的使用wEdit方法是Display方法的扩展他既用于显示也用于接受用户的输入.wEdit方法使用的地方:Table 里的方法.Form的方法.Form

47、数据源的方法.wEdit方法用在Table里的例子:edit FreeTxt TxtDefault(boolean Set, FreeTxt Txt)第一个参数是布尔类型的参数.第二个是要返回与要接受用户数据的参数.Edit方法使用在窗体时数据源时:edit Amount Settle(boolean set, CustTrans _CustTrans, Amount U)标准 lookup form的组成:wTitleField1 from the related table(关联的表的标题字段1)wTitleField2 from the related table(关联的表的标题字段2)wThe fields

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论