When customizing source code and metadata of model elements that are shipped by Microsoft or third-party Microsoft partners you may not be able to save the customized object.
It’s a common mistake to open and customize objects directly from AOT, specially for developers from AX2009/2012.
In our test case scenario I tried to customize Batch macro, which belongs to Application Platform package, and use the function Add to new project.
The result is a new solution with a project which belongs to Application Platform package from SYS layer, trying to customize the object from SYS layer will trigger the error “Unauthorized to modify model “.
AX7 allows developers to overlay (like in previous versions) which is a powerful tool to perform advanced customizations of metadata and source code, but may increase the cost of upgrading a Dynamics ‘AX 7’ solution to a new version. Extensions enables you to add functionality to existing code. Extensions are not available to all objects and have a few limitations, Events should be used on Classes.
When overlaying is necessary, you must must create a new model that overlays the model you want to customize. To create a new model go to Dynamics AX -> Model Management -> Create model. When overlaying a existing element you must select a existing package so I recommend for model’s name the following rule:
Overlaying Package_Layer_Company
Company name should be necessary if you are developing for a client with customizations from two or more development company.
Select the existing package which you wish to overlay.
When you are done, you can create a new project or edit your project’s model.
If you want to edit your project’s model, you will have to exclude from project any object inside it, then you select it, right-click and choose Properties.
You can change the model and it will automatically change the layer.
Now you can add the object back to your project and start customizing it.
