In Dynamics AX it’s possible to add in document reference in many forms using the document handling functionality. However, when you sometimes delete a record that has an associated document reference; this reference in the DocuRef table remains. This is due to the fact that there is not always a relation between a table and DocuRef. Therefore if you run the consistency check report, you may find that you see lots of missing references found as the parent table record no longer exist.
One example of this is the ProdTable, for production orders. In order to make this function so that whenever you delete a record, it deletes the associated document reference follow these steps below (this example if for ProdTable, but just follow the same process for your required tables):
Note: Please make sure that you have backups of application files and data before making changes.