The Reusable Dynamics NAV Patterns is a joint initiative between the NAV team NAV partners. This is an open initiative to anyone who has documented design patterns which are specific to NAV, please reach back to us either by leaving a comment here, or by writing to us. This being said, find below the NAV design pattern of the week.
The goal of the Copy Document pattern is to create a replica of an existing open or closed document (posted or not posted), by moving the lines and, optionally, the header information from the source document to a destination document.
Documents are widely used by most of our customers. Many times, a significant portion of these documents are similar to each other, either by sharing the same customer, vendor, type, or line structure. Being able to re-use a document as a base for creating a new one is therefore an important means of saving time.
Other business scenarios require that a newly created document is applied to an existing document. For example, in returns management, a return order can be the reversal of an existing order and can therefore be copied from the original order. Other times, there is even a legal requirement to match the document to its source. For example, credit memos need to be applied to the originating Invoice.
For these reasons, NAV supports the copying of documents as a method to re-use or link documents.
The Copy Document functionality is used in the following situations:
The Dynamics NAV application developer can take into account using the Copy Document design pattern when they have requirements such as:
The Copy Document pattern involves the following entities:
Note:The source document header/line and destination document header/line tables do not need to be the same. For example, you can copy a Sales Shipment Header/Lines into a Sales Header/Lines.
Precondition: The user creates a new destination document Header, filling up the required information.
Step 1: The user runs the Copy Document report (element no. 4), filling up the parameters:
Step 2: The report copies the information in the source tables (Header and Line) into the destination tables (Header and Line).
Post processing: The user performs additional editing of the destination document.
The sequence flow of the pattern is described in the following diagram.
Example: Copy Sales Document for Credit Memos.
In the standard version of Microsoft Dynamics NAV, the Copy Document functionality is implemented in the Sales Credit Memo window as shown in the following section.
Precondition: The user enters data in PAGE44, Sales Credit Memo.
Step 1: The user runs REP292, Copy Sales Document from the Sales Credit Memo window, populating the required parameters. The Include Header and Recalculate Lines fields are selected.
Step 2: The Sales Credit Memo window is populated with information from the source sales document.
Post processing: The user can now do additional editing of the sales credit memo.
The Reusable Dynamics NAV Patterns team with special thanks to Bogdan Sturzoiu
Thank you for sharing.