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

Announcements

No record found.

News and Announcements icon
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?
  • Verified answer
    Martin Dráb Profile Picture
    240,900 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
    240,900 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 528 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 376

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans