Technical description
When creating History for a Document, we move the data from one set of Document tables to another. This is done using a number of Codeunit objects.
The naming conventions
From a functional perspective, this process has many names, such as Posting, Archiving, Issuing, and Registering. This term is used in the User Interface, and should functionally apply to the task.
The Document tables, where we move the data to, have no business logic and exist only for historical reasons. In the standard Microsoft Dynamics NAV Application, they can be removed after printing.
Note
The History Document Tables should therefore never be used for data analysis and reporting purposes.
Codeunit Structure
The Codeunit object used for the process has a logical flow called Test Near, Test Far, Do It, and Clean up.
Test Near, Test Far
Before the process starts, we need to make sure that everything is in place. It does not make sense to create records in the database, and then...