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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

(0) ShareShare
ReportReport
Posted on by 75

Any help would really be appreciated.

I have a requirement wherein I need to create Object and Object Extension in D365/AX7 through X++ code   

*This post is locked for comments

I have the same question (0)
  • GopalRC Profile Picture
    75 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi Sukrut Parab,

     

    I have gone through the link.

    I mean I need to create objects through X++ code in D365.

  • GopalRC Profile Picture
    75 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    HI Sukrut Parab,

     

    I have a sample code, using the standard class of D365 I'm trying to create a Class object.

    It throws an exception any Idea please find Screenshot.

     

    CreateObjectThroughCode.png

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    What is your business requirement?

    You can't create new AOT objects during runtime with D365FO, like you could with previous versions of Dynamics AX. Your sample code is clearly intended to be used with Dynamics AX 2012 or older version, not Dynamics 365 for Operations.

    You can create new AOT objects only with Visual Studio. Then you build them to dll assemblies, and deploy to test/prod.

    It's not possible to create new AOT objects in test/prod, there you can only run the assemblies that you created in dev/build.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi GopalRC,

    As the development environment has been separated from the application in comparison with AX2012, you cannot create all type of objects like before. Using some dlls, Microsoft is now able to create runtime extensions for table fields and security artifacts. You can still add form objects with x++ coding on existing forms.

    What is the exact scenario you are trying to achieve? Then it would be much easier to tell you if your scenario is possible or not.

  • GopalRC Profile Picture
    75 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi André Arnaud and Nikolaos,

    below is the requirement.

    I have an excel file which consists of table metadata.

    Reading the excel file, I need to create a new table in D365 with proper table structure.

  • GopalRC Profile Picture
    75 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi Sukrut, André Arnaud, and Nikolaos,

    I would do only in "Development environment", Not in the Production environment.

    Basically, I'm trying to create an Automation tool which would be able to create Table, classes etc in "Development environment" reading the metadata file(Excel/XML etc.).

  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi Gopal,

    In this case, you should have a look if you can create a Visual Studio extension (similar to Data entity wizard) which is able to create new object files (xml-based). I'm not familiar with this type of extensions.

  • GopalRC Profile Picture
    75 on at
    RE: How to create Objects(tables/class etc) and Object extension(tables extension / class extension etc) through X++ code in D365 VS

    Hi Sukrut, André Arnaud, and Nikolaos,

    As you people said in above reply, I was suspecting same. So, after your suggestion, it stopped me from going in dark directions. :-)

    D365 F&O: Findings as follows

    1. I'm able to create a new Table and its contents by manually placing the XML file format on to the respective model.
    2. I'm able to create Extension of Table and its contents by manually placing the XML file format on to the respective model.

    Could you please let me know is there any impact on the above approach?

    Point of Action: I would develop a logic which will create an XML file(by reading XML, Excel etc)in the D365 format and place it in the right model folder on local D365 VM.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans