Today I have to delete all legal entities from one of MS Dynamics Ax 2012 environment.
During this I got following error while deleting legal entities.
“Can not record , The corresponding AOS validation failed”.
This error clearly shows that Transnational data exists in that legal entity.
I follow these steps to clear all legal entities.
- First of open AOT with development rights.
- Change the legal entity from DAT to required legal entity.
- From AOT, expand the Class node, type SysdatabaseTransDelete. When find, right click on it click it open / run. It will delete all transactional history of required legal entity.
- Now open the new workspace and open Organization Administrator ion => setup=>organization => legal entities.
- Select on required legal entity and click on delete from top menu.
Some but on some legal entities delete button is still disabled. Because there is no important data as well I want to delete all legal entities, I manually delete the data in RCHYRELATIONSHIP table.
Otherwise I have to delete the organization hierarchy data carefully.
Following two links help me to solve this issue.