Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Moving code from USR to CUS Layer

Posted on by 1,289

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

*This post is locked for comments

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,289 on at
    RE: Moving code from USR to CUS Layer

    This type of error occurs when a project is in both CUS and USR layer.

    You can go through all your projects and export project to an xpo which has both CUS and USR layer and delete the USR layer of the projects.

    Or

    To find out to which project this error is referring to,

    Write a SQL Query in  Model Database

    select * from modelelement

    where elementhandle = '1120873'

    and then export an xpo of the project and delete the USR layer.

  • István Orosz Profile Picture
    István Orosz 2,137 on at
    RE: Moving code from USR to CUS Layer

    Hi,

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

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,289 on at
    RE: Moving code from USR to CUS Layer

    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.

    AXModel-Import.png

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,289 on at
    RE: Moving code from USR to CUS Layer

    Hi,

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

    Thanks,

    Lakshmi

  • István Orosz Profile Picture
    István Orosz 2,137 on at
    RE: Moving code from USR to CUS Layer

    Hi,

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

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,647 Moderator on at
    RE: Moving code from USR to CUS Layer

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

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,289 on at
    RE: Moving code from USR to CUS Layer

    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

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,647 Moderator on at
    RE: Moving code from USR to CUS Layer

    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

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,289 on at
    RE: Moving code from USR to CUS Layer

    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

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Moving code from USR to CUS Layer

    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".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans