SBX - Search With Button

SBX - Forum Post Title

Moving code from USR to CUS Layer

Microsoft Dynamics AX Forum

Lakshmi Karambakkam asked a question on 5 Jun 2019 4:13 PM
My Badges

Question Status

Suggested Answer

hi,

I have to move all the code in USR layer to CUS layer. What is the checklist to be followed and is there any guidelines that will help me in doing this as I am moving the code between layers for the first time.

Thanks,

Lakshmi

Reply
Satish Panwar responded on 5 Jun 2019 4:28 PM
Suggested Answer

Hi Lakshmi,

Please see link below. This provide great details and also make sure you don't lose data and object id's remains the same.

blogs.msdn.microsoft.com/.../moving-customizations-between-layers-in-dynamics-ax-2012

Make sure you have a good set of backup's before you start this activity just incase you need to restart for some reason. Hopefully you won't need it.

Reply
Lakshmi Karambakkam responded on 11 Jun 2019 12:49 PM
My Badges

Hi Satish,

I am not sure how to work with point 6 in the link you sent me.

6.  Export the CUS layer models from sandbox environment into axmodel files and import them into the source environment, with the USR layer still in place.

How to find CUS Layer models and how to add them as axmodel files? Please guide me.

Thanks,

Lakshmi

Reply
Suggested Answer

In AX model list (which you can see for example in development workspace -> Tools -> Model management -> Models installed) you will see which layer the model is on. So this is how you can find CUS layer models. And how to export models to axmodel files? Well, just search the web for "dynamics ax 2012 export model".

Reply
Lakshmi Karambakkam responded on 11 Jun 2019 2:10 PM
My Badges

Now, I started working on this process. Step 1:

To pull all AOT objects modified in USR layer , I followed the below link

docs.microsoft.com/.../how-to-export-elements-from-a-selected-layer

But this xpo has AOT objects from Data dictionary, macro, classes, forms only. It is not pulling from other AOT objects like reports, parts, services, and other remaining places.

Am I missing anything?

There is enough disk space (40 GB)  to run the process.

Thanks,

lakshmi

Reply
Suggested Answer

If you want XPO specific to layers , you can use below link to filter all the element  in a project and then take XPO

community.dynamics.com/.../microsoft-dynamics-ax-2012-quick-trick-generating-list-of-aot-changes-utilizing-the-project-filter

Reply
Lakshmi Karambakkam responded on 13 Jun 2019 10:34 AM
My Badges

I pulled Source environment USR objects to sandbox environment and later exported CUS model into Source envirornment. Now I have to do the last step.

Delete USR layer from source environment.

When I tried to do it using management shell, i got the below message:

"The deletion will cause the following elements in other models to be deleted:

  Model: CUS Model

Classes\<Class name> \Methods 1-8

Forms \.<Form Name> \...\DesignList\.......\Methods\Clicked

Are you sure you want to delete the layer : Usr (y/N) ?  "

what could be the reason for trying to delete these elements in CUS layer?   Guide me.

Thanks,

Lakshmi

Reply
Suggested Answer

You can delete it from project as well. Just filter project by usr layer as I suggested above and delete all objects.

Reply
István Orosz responded on 14 Jun 2019 8:25 AM
My Badges

Hi,

CUS model is the default model for CUS layer, the modifications are usually in another modell (on CUS layer)

Reply
Lakshmi Karambakkam responded on 14 Jun 2019 3:10 PM
My Badges

Hi,

Is there any x++ code/job that will pull all the models in a given layer.

Thanks,

Lakshmi

Reply
Lakshmi Karambakkam responded on 16 Jun 2019 10:53 AM
My Badges

I found the list of models by Tools\Model Management\Change current model and tried to import the models.

I got the below error

How to fix this? Do i need to delete the old cus model and then import the new one?

Please guide me.

Reply
István Orosz responded on 17 Jun 2019 1:57 AM
My Badges

Hi,

You can create a project from a specific layer, is that what you need?

Reply
Satish Panwar responded on 5 Jun 2019 4:28 PM
Suggested Answer

Hi Lakshmi,

Please see link below. This provide great details and also make sure you don't lose data and object id's remains the same.

blogs.msdn.microsoft.com/.../moving-customizations-between-layers-in-dynamics-ax-2012

Make sure you have a good set of backup's before you start this activity just incase you need to restart for some reason. Hopefully you won't need it.

Reply
Suggested Answer

In AX model list (which you can see for example in development workspace -> Tools -> Model management -> Models installed) you will see which layer the model is on. So this is how you can find CUS layer models. And how to export models to axmodel files? Well, just search the web for "dynamics ax 2012 export model".

Reply
Suggested Answer

If you want XPO specific to layers , you can use below link to filter all the element  in a project and then take XPO

community.dynamics.com/.../microsoft-dynamics-ax-2012-quick-trick-generating-list-of-aot-changes-utilizing-the-project-filter

Reply
Suggested Answer

You can delete it from project as well. Just filter project by usr layer as I suggested above and delete all objects.

Reply

SBX - Two Col Forum

SBX - Migrated JS