Tuesday, November 1, 2011

Application object layers and patch layers in AX

any code changes made on an AX object will reflect on all companies unless we have a condition that checks for the company in which your are currently accessing. The code separation that I am planning is to customize or create new AX objects only in the usr layer. It is a separation that AX offers so we can override the logic in the lower layer. However, the Flight Stats project will most likely create lots of new objects and will modify only very few standard objects.
One easy way to see all the layers available in AX is to go to the AX Configuration Utility. To access the utility, click on the Windows Start button, go to Control Panel / Administrative Tools / Microsoft Dynamics AX 2009 Configuration. If you see all the fields on the client configuration disabled, click on the Manage button and select Create configuration… Provide a name for the configuration. I gave the name Sample. Click on the Developer tab and you will see all the AX layers in the Application object layer to open dropdown. You can delete the configuration by clicking on the Manage button and then select the option Delete configuration.
Here are the list of layers in AX. Non-bold layers are the patch layers.
  1. sys
  2. syp
  3. gls
  4. glp
  5. hfx
  6. sl1
  7. sl2
  8. sl3
  9. bus
  10. bup
  11. var
  12. vap
  13. cus
  14. cup
  15. usr
  16. usp
    Each layer has its own significance. You can read more about these layers in MSDN website:
Application Object Layers
Application Object Patch Layers
I have decided to use the usr layer to do Flight Stats application coding. usr, usp, cus and cup are the layers that I have currently access to. So, one day if I decide to delete all the code in a particular layer (say usr). All I have to do is navigate to the path where the application files are installed. In my case, they are installed in the path E:\Program Files\Microsoft Dynamics AX\50\Application\Appl\DEVDAX50Base. Then, I need to search for the files with extension *.aod and simply delete the axusr.aod file**. The AOS service should be stopped in order to delete any application file. The file extension aod stands for Application Object Data. There will be one aod file for each of the layer that has been customized in addition to the standard aod files that come out of the box. In the below screenshot, you don’t see any files like axcup.aod, axcus.aod or axusp.aod because I didn’t customize AX objects in any of these layers. Ok, I am not going to delete any files now! I was just showing how to get rid of all the customizations from any given layer in an easier manner.
NOTE: ** Please be careful and always take backups whenever you are deleting important files. By the way, you are on your own if you delete any aod file. So, please make sure that you understand the full consequences of what you are doing.
So, the Flight Stats project code will reside in usr layer. In the next post, I will discuss about creating a shared project to group all the objects that are created or modified as part of Flight Stats application.

No comments:

Post a Comment