Monday, September 25, 2023

Call insert or update for dataentity

Var enumerator = entityNames.getEnumerator();

while (enumerator.MoveNext())
{
	Microsoft.Dynamics.AX.Metadata.MetaModel.AxDataEntityView DataEntity = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetDataEntityView(enumerator.Current);
	//matching with publicname of the entity
	if(DataEntity.PublicEntityName == parentNodeName)
	{
		entityName  = DataEntity.Name;
		dictTable   = new SysDictTable(tableName2Id(entityName));
		dictDataEntity   = new DictDataEntity(tableName2Id(entityName));
		common           = dictDataEntity.makeRecord();
		break;
	}
}
ttsbegin;
dictDataEntity.callObject("Write", common);
ttscommit;

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8