web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to delete a class from a Model

(1) ShareShare
ReportReport
Posted on by 117
I was trying to follow a tutorial with zero knowledge of D365 programming. The tutorial gave a definition for class A. I created a project, added a new class and added the code for A. It didn't compile. I commented out some stuff just to make it compile and try to pin down the error. I eventually realised that a method in class A was referring to a Table in another Model. Now I want to:
 
  1. Create a new Model for my stuff (when I created my project, it defaulted to the Fleet Management model, but I didn't know that, and I didn't know that I needed to know that);
  2. Add the Package reference that I need (Update model parameters -> Select referenced packages -> ApplicationSuite);
  3. Recreate class A from the tutorial in my new project based on my new Model.
However, I can't do (3) because it say that class A exists. I searched AOT and found that it exists in model Fleet Management. I right-clicked it hoping to see /Delete/ but no such luck. 
 
I could probably proceed by renaming tutorial class A in my new project but since I littered Fleet Management I need to clean it up. How do I delete class A from package Fleet Management in AOT?
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,866 Most Valuable Professional on at
    You have two options. Either create a project for Fleet Management (or open one if you already have it), add Class A there and delete it. You can't delete it directly in Application Explorer. Or delete the file directly on disk (not in Visual Studio).
     
    Then rebuild Fleet Management module, to apply this change of source code to compiler binaries.
  • CD-28072126-0 Profile Picture
    117 on at
    Thanks, Martin.

    While waiting for a response, based on Googling and my build error messages ("Location of the log file is ..."), I eventually found it.

    I located the files related to my class at
    C:\AOSService\FleetManagement\FleetManagement\AxClass\A.xml
    C:\AOSService\FleetManagement\XppMetadata\FleetManagement\AxClass\A.xml
    C:\AOSService\PackagesLocalDirectory\bin\XppSource\FleetManagement\AxClass_A.xpp
     
    I backed them up, deleted them, rebuilt the model (Visual Studio menu -> Extensions -> Dynamics 365\Build Models
    Packages -> Fleet Management
    Options
    -> Build Pre-Compiled Form
    -> Build Reports
    -> Build Cross Reference Data
    -> Synchronize Database

    I don't know which of these were necessary.
  • Martin Dráb Profile Picture
    237,866 Most Valuable Professional on at
    Only the first one is relevant; that's the source code file.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 659 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 533 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans