var entityNames = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntityViewNames(); Var enumerator = entityNames.getEnumerator(); while (enumerator.MoveNext()) { enumerator.MoveNext(); Microsoft.Dynamics.AX.Metadata.MetaModel.AxDataEntityView DataEntity = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntityView(enumerator.Current); if (DataEntity) { info(strFmt("Entity Name: %1 -- Entity Label; %2 -- Entity public collection Name: %3 -- Entity Public Name %4 -- Is Entity Public - %5--Is Entity Shared - %6", DataEntity.Name, SysLabel::labelId2String(DataEntity.Label), DataEntity.PublicCollectionName, DataEntity.PublicEntityName, DataEntity.IsPublic, DataEntity.PrimaryCompanyContext)); } }
This blog is contains coding reference related to Microsoft AX 2012 and D365 finance and operations and Power platform
Monday, September 25, 2023
X++ code to get metadata of data entities
Get D365Fo Host name
using Microsoft.Dynamics.ApplicationPlatform.Environment; public str GetInfrastructureHost() { IApplicationEnvironment env = EnvironmentFactory::GetApplicationEnvironment(); str hostUrl = env.Infrastructure.HostUrl; // Trim https:// hostUrl = subStr(hostUrl, 9, strLen(hostUrl) - 8); return subStr(hostUrl, 1, strFind(hostUrl, '.', 1, strLen(hostUrl)) - 1); }
Subscribe to:
Posts (Atom)