Leader Board

Delete User Layer with AX 2012 Management Shell


this is going to be a short post about how to delete a user layer from the model store in AX 2012.

to delete a user layer from the model you first need to install theManagement Tools from your AX 2012 setup. Once this is done, you can access the Microsoft Dynamics AX Management Shell and write the following script:

axutil delete /layer:Usr

See the picture below for more details:

 

As you can see, deleting a layer is not difficult at all and it happens fairly quick too. Also, it is very important that you have a backup of the databasebefore performing this action.

How to create project with all objects in Specific layer In Dynamics AX

 

Challenges:

  • When investigating code in Ax, it may be useful to get a quick overview of all the code in a specific layer.
  • When you intend to move code from one layer to another, you may need a list of objects in a specific layer.
Follow these steps in order to get a solution for both challenges with ease:
Step 1: Create a new project.


You can rename your project as desired, we'll call it Project_USR_Layer for now. Then open the newly created project.

Step 2: Choose Advanced Filter/Sort from the toolbar.


If you are into keyboard short-cuts, you can use Ctrl-F3 for this as well.
A new dialog pops up.

I like my objects grouped in the project as they are grouped in the AOT, so I've chosen Groupings - AOT.
Step 3: Select the required objects.

Use the Select button on the dialog to select the objects you require for your project.
We want select all AOT objects from a specific layer, so we'll use the UtilLevel field in the selection criteria.

From the screenshot you can see that all objects from the USR layer are selected. If desired, you can limit the type of AOT objects for your project as well, by using the recordTypefield.
Confirm twice and the objects are added to your project. This may take some time, so be patient :-)

Similar challenge:

You can use the same method for selecting AOT objects modified/created by a specific programmer. Just set different selecting criteria in your query.