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

Export data schema from AOT

(0) ShareShare
ReportReport
Posted on by 4,131

Hi,

Is there any tool to export table schema with the information like field name, string size, field label etc. from AOT? I recalled there was a reverse engineering tool in AX 2009.

Thanks,

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    I don't think any tool exist like that. You can look at metadata API and check if you can get results you want through it.

  • Suggested answer
    Ajit Profile Picture
    8,755 on at

    You can review below blog -

    ajit-newdynamicsax.blogspot.com/.../metadata-lookup-list-of-forms-in-d365.html

    You can try getTableFields instead of FormNames

  • Verified answer
    Blue Wang Profile Picture
    on at

    Hi Yuji,

    Microsoft.Dynamics.Ax.Xpp.MetadataSupport offers many static methods providing information about elements.

    02878.PNG

    You need to pay attention to the return type, such as GetTable () returns an instance of AxTable class, so you need to reference the namespace. 

    using Microsoft.Dynamics.AX.Metadata.MetaModel;

    Please refer this blog: https://community.dynamics.com/365/financeandoperations/b/ievgensaxblog/posts/ax7-get-information-about-table-extension-using-microsoft-dynamics-ax-xpp-metadatasupport

  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Yuji,

    Please run the following SQL in SSMS.

    SELECT CASE WHEN col.colorder = 1 THEN obj.name
    ELSE ''
    END AS tablename,
    Coalesce(epTwo.value, '') AS documentation,
    col.colorder AS num ,
    col.name AS fieldname ,
    ISNULL(ep.[value], '') AS description1 ,
    t.name AS type ,
    col.length AS length1 ,
    ISNULL(COLUMNPROPERTY(col.id, col.name, 'Scale'), 0) AS Decimaldigit ,
    CASE WHEN COLUMNPROPERTY(col.id, col.name, 'IsIdentity') = 1 THEN '1'
    ELSE ''
    END AS Identification ,
    CASE WHEN EXISTS ( SELECT 1
    FROM dbo.sysindexes si
    INNER JOIN dbo.sysindexkeys sik ON si.id = sik.id
    AND si.indid = sik.indid
    INNER JOIN dbo.syscolumns sc ON sc.id = sik.id
    AND sc.colid = sik.colid
    INNER JOIN dbo.sysobjects so ON so.name = si.name
    AND so.xtype = 'PK'
    WHERE sc.id = col.id
    AND sc.colid = col.colid ) THEN '1'
    ELSE ''
    END AS Primarykey ,
    CASE WHEN col.isnullable = 1 THEN '1'
    ELSE ''
    END AS nullornot ,
    ISNULL(comm.text, '') AS Defaultvalue
    FROM dbo.syscolumns col
    LEFT JOIN dbo.systypes t ON col.xtype = t.xusertype
    inner JOIN dbo.sysobjects obj ON col.id = obj.id
    AND obj.xtype = 'U'
    AND obj.status >= 0
    LEFT JOIN dbo.syscomments comm ON col.cdefault = comm.id
    LEFT JOIN sys.extended_properties ep ON col.id = ep.major_id
    AND col.colid = ep.minor_id
    AND ep.name = 'MS_Description'
    LEFT JOIN sys.extended_properties epTwo ON obj.id = epTwo.major_id
    AND epTwo.minor_id = 0
    AND epTwo.name = 'MS_Description'
    WHERE obj.name in(
    SELECT
    ob.name
    FROM sys.objects AS ob
    LEFT OUTER JOIN sys.extended_properties AS ep
    ON ep.major_id = ob.object_id
    AND ep.class = 1
    AND ep.minor_id = 0
    WHERE ObjectProperty(ob.object_id, 'IsUserTable') = 1
    )
    ORDER BY obj.name ;

    Get the following data:

    Capture66666.PNG

    Hope this helps.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    I wouldn't use SQL. it doesn't meet the requirements, because the database doesn't contain labels (among other potentially interesting metadata). Also, the data model in database doesn't precisely match the data model defined in AOT - same names are different, the whole table inheritance hierarchy (e.g. 10 tables in AOT) is a single table in database, database has timezone fields for utcDateTime fields and so on...

  • WillWU Profile Picture
    22,361 on at

    Hi Martin,

    Thank you for your guidance, I'm sorry for that I missed the label.

    Hope my answer can provide some ideas.

  • Suggested answer
    Rahul Mohta Profile Picture
    21,032 on at

    could possibly use XML tools to parse and get the schema generated in a a Dev box using the AOSService folder and user the package of your choice

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Just out of curiosity, what benefits do you see in dealing with XML files directly rather then using the new metadata API provided by Microsoft? You would have to re-implement many things that are already there (parsing XML files, combining multiple files, interpreting the data...), therefore I wonder why would you do it.

    I sometimes search the files directly, but in this case, using the API looks much easier to me.

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 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans