After a new installation of AX Dynamics on a french operating system (things we never should implement), I checked entities of the new DIXF system and many errors on those.
On few entities, edition et mapping generation didn't work with strange message :
"Column is empty" on edition of an entities for example or also The ' ' character, hexadecimal value 0x27, cannot be included in a name (DMFXMLWizard execution)...
After debug, the problem was localized on entity name which was in french character.
DMFEntityName table initializes default entities with the current language of current user when AX Dynamics is installed.
I had to reinitialize default entities name by standard table method and regenerate mapping on DIXF.
I join my job to do that.
// Job to regenerate default entity on the right language
// Login with EN-US language and run the job.
static void regenerateDefaultEntity(Args _args)
{
DMFEntity dmfEntityOLD, dmfEntityUpd;
void deleteDMFTargetMapping(DMFEntityName _oldEntityName)
{
DMFTargetXMLToEntityMap dmfTargetXMLToEntityMap;
// delete specified target Mapping
ttsBegin;
delete_from dmfTargetXMLToEntityMap where dmfTargetXMLToEntityMap.Entity == _oldEntityName;
ttsCommit;
info(strFmt("Entity %1 deleted",_oldEntityName));
}
void regenerateDMFTargetMapping(DMFEntityName _newEntityName)
{
DMFTargetXMLToEntityMap dmfTargetXMLToEntityMap;
DMFEntity dmfEntity;
// Regenerate Target Mapping for specified Entity
select dmfEntity where dmfEntity.EntityName == _newEntityName;
{
DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
}
info(strFmt("Entity %1 generated",_newEntityName));
}
;
if(Box::yesNo("Do you want to regenerate DMF entities?", DialogButton::Yes))
{
while select forUpdate dmfEntityOLD
//where dmfEntityOLD.EntityName == "Codes Taxe" // for test
{
if (dmfEntityOLD.EntityType == DMFEntityTypes::Entity)
{
ttsBegin;
dmfEntityUpd = dmfEntity::find(dmfEntityOLD.EntityName,true);
dmfEntityUpd.defaultModule(dmfEntityOLD.EntityTypeName);
dmfEntityUpd.update();
ttsCommit;
deleteDMFTargetMapping(dmfEntityOLD.EntityName);
regenerateDMFTargetMapping(dmfEntityUpd.EntityName);
}
}
info("Process over");
}
else
{
info("Process cancelled");
}
}
Hope it helps someone with the same problem.
Thank you for this post which resolve for me regeneration !
No comments:
Post a Comment