28.10.2006, 18:22 | #1 |
Участник
|
Axapta Lessons: Exporting Tables and Class definitions
Источник: http://axapta-lessons-learned.blogsp...finitions.html
============== "Tables and classes are handled differently than other application objects. When we export a table or a class, only the members that have been created or modified in the layer we are exporting (current layer) from are included in the export. When you later import such objects, you should make sure that the Delete table and class members check box is not selected." (developer's guide) Some more explanation about the current layer is needed here. The current layer is either the layer from which we are exporting the object or the selected layer version of an object. For most people this will be the VAR, BUS, CUS or USR layer. However while we are in a layer we can export definitions from another layer. We have to ensure that the field Application object layer under tab Development in Options (Tools, Options in the toolbar menu), is set to Show all layers. Right-click the object, select layers from the shortcut menu. Now the definitions of the object for each layer is displayed. We can now export the definitions of another layer by selecting the layer definition. When exporting the definitions all what belongs to the layer and lower layers is exported. When operating in the VAR Layer the lower layers are GLS, DIS and so on. The USR Layer is a higher layer. Example: Let us create an example. Open Axapta in the USR layer (normal mode). Create a new class. Name it AA. (in the ClassDeclaration put class AA) Create a new method on the class and name it TestUSR. Open Axapta in another layer, here the VAR layer. Create a new method on the class and name it TestVAR. Now the class in the VAR Layer looks as follows: When we enable layers the class looks like this: Put the cursor on the VAR layer definition and export the object. Put the cursor on the USR layer definition and export the object. Now compare the two files that have been created. The VAR layer XPO-file contains only the method TestVAR. Remarks: When we export the object from the VAR layer without enabling layers, the whole object definition is exported, also the definition of the USR layer. This raises some questions about the statement "make sure that the Delete table and class members check box is not selected when importing these tables or classes" in the developer's guide. The example shows that the complete definition is exported and not only the modified or new members of the class. [End of Lesson] ============== Источник: http://axapta-lessons-learned.blogsp...finitions.html |
|