How to List Down Data Entities with Data Management Enabled- D365F&O
Ajit
8,755
class demoGetListofDataEntityObjects
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
demoGetListofDataEntityObjects entityObj =new demoGetListofDataEntityObjects();
entityObj.run();
}
public void run()
{
#define.EnLanguageId('en-us')
str tableName;
TableName tn;
demoDataEntityLabels elabels; - //Table Variable
delete_from elabels;
List entityList;
ListEnumerator enumerator;
DictDataEntity dataEntity;
DMFEntity dmfEntity;
DMFEntityName entityName;
entityList = DictDataEntity::listOfDataEntities();
enumerator = entityList.getEnumerator();
while(enumerator.moveNext())
{
dataEntity = new DictDataEntity(tablename2id(enumerator.current()));
entityName = SysLabel::labelId2String2(dataEntity.labelDefined(), #EnLanguageId);
if (dataEntity.dataManagementEnabled())
{
elabels.clear();
elabels.TableName = enumerator.current();
elabels.EntityName = entityName;
elabels.insert();
}
}
}
}
#D365F&O #DataEntities #MSDyn365F&O
*This post is locked for comments