Monday, September 25, 2023

X++ code to get metadata of data entities

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));
     }
}

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8