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 :
Microsoft Dynamics AX (Archived)

Get metadata, data sources of a data entity

(0) ShareShare
ReportReport
Posted on by

Would like to display nested data sources, fields, relations for an entity such as customers, 

attempting to use AXDataEntity CCE = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntity("CustCustomerEntity");

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Hi solutionx,

    Please try next code

            Microsoft.Dynamics.AX.Metadata.MetaModel.AxDataEntityView axDataEntity = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntityView("CustCustomerEntity");
    
            Microsoft.Dynamics.AX.Metadata.MetaModel.AxQuerySimple query = axDataEntity.ViewMetadata;
            var dataSources = query.DataSources;
            System.Collections.IEnumerator dataSourcesEnumerator = dataSources.GetEnumerator();
    
            while (dataSourcesEnumerator.moveNext())
            {
                Microsoft.Dynamics.AX.Metadata.MetaModel.AxQuerySimpleDataSource dataSource = dataSourcesEnumerator.get_Current();
            }


  • Midhun Profile Picture
    55 on at

    Hi Miroshnikov,

    Even am also looking for the same utility.. thank Miroshnikov, its working perfectly.

    Regards,

    Midhun

  • Midhun Profile Picture
    55 on at

    HI ievgen,

    can we get all the releted data entity names realated to tables by using the tableNames? what i want is if i can pass a tableName, i need to get the data entities which that table is related.

    looking forward to see your response,

    Midhun.

  • Mea_ Profile Picture
    60,286 on at

    Hi Midhun,

    Please create new thread for new question.

  • Midhun Profile Picture
    55 on at

    Hi ievgen,

    Actually that not what i meant. I have to make a inquiry form which  will list all the table names and related entity names.. its kind of a utiliy. so for that i have the names of table, so by using that i need to find out the entity.

  • princem Profile Picture
    72 on at

    Hi Ivgen,

    I am trying your code to get the list of datasources used in a dataentity but only getting the first datasource(root).Can you suggest what changes are required ?

    Thanks

    PM

  • Mea_ Profile Picture
    60,286 on at

    You need to tell us more, like data entity name and code you have used.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans