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 :
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,284 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,284 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,284 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

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

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans