Skip to main content

Notifications

Get metadata, data sources of a data entity D365FO

Amir Nazim Profile Picture Amir Nazim 5,994
this piece of code can be used for get the data sources involve in making the data entity.
 
  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();
        }

This was originally posted here.

Comments

*This post is locked for comments