Friday, February 28, 2014

Cannot delete record from table Ledger (Ledger). The corresponding AOS validation failed.



The error message "The corresponding AOS validation failed." may appear when you try to delete a company from the AX environment. Basically, this error is related to the validations places in aosValidateDelete method written on the specified table which prevents users to delete the data from that table. This is just another layer of validations and security on top of the standard framework. But we may get the error message on different other occasions as well for example AIF or batch jobs.  

Dynamics Ax tables have below four methods for AOS validation available:

  • aosValidateDelete
  • aosValidateInsert
  • aosValidateRead
  • aosValidateUpdate


Method Description
aosValidateDelete Validates on the server that the specified record may be deleted from a table.
aosValidateInsert Validates on the server that the specified record may be inserted into a table.
aosValidateRead Validates on the server that the specified record may be read.
aosValidateUpdate Validates on the server that the specified record may be updated.

These methods give us the extra tools to limit access to a table.  For example decide who can read from a table, who is allowed to update records etc. You, simply, need to open the method which is creating problem in the company deletion and act accordingly. Please note that Overwriting/Commenting the code in these methods can have big impacts.


No comments:

Post a Comment