Document Pattern

The EARP systems are traditionally designed to help companies administer the paper trail, required to run their businesses, often from a legal perspective. To be able to register the paper documents in an electronic form, Document Pattern can be used.

Technical description

The Document pattern allows us to enter a header and line information. The header information is often related to Person Master Data (with whom I am doing business), whereas the lines are of the type Product (the kind of business that I am doing).

Each Document Pattern has two tables: a header and line. These names are important, the Sales Header and the Sales Line tables follow this convention, just as others.

The Header table

The header table has a primary key that is called No., and has a type Code with a length of 20 characters. Optionally, the primary key can also contain a reference to a normalized document type. Normalized in this case means that the share tables and business logic, for physically different documents, have a functional resemblance, such as Sales Quotes and Sales Invoices.

The value of the primary key is most often determined using Number Series Design Pattern.

The header tables, most often, contain a reference to the required Master Data or Supplemental & Subsidiary Tables. This includes using the Address Integration Pattern.

From a workflow perspective, the Entity State Design Pattern is popular in combination with the Document pattern. This tells the system the status of a document. We can have multiple instances of the Entity State Design Pattern in one document.

Note

The Address Integration and the Entity State patterns are mentioned in Chapter 3, Design Patterns.

The header table has at least two page objects: a non-editable list page, and an editable document page.

The Line table

The primary key of a line table contains a reference to the primary key of the header table with an additional field called Line No. of the type Integer. This field should be the last field in the Primary Key, because the Line No. field is populated using the AutoSplitKey property on the subpage. The Line table can contain references to one or more Product Master Data tables. This table has a single page object of the type called ListPart that is used as a SubPage for the Document Page.

The following diagram explains how to implement Document Pattern. Please note that the Document Type is optional:

The Line table

Posting and archiving

Documents follow a flow through the company, and sometimes even leave the company in the form of a shipping bill or sales invoice. Sometimes, a single document creates several other documents, and triggers the creation of entries in the accounting or inventory part of the system.

To enable this, the Create History pattern is used. We will discuss this later, in Chapter 3, Design Patterns.

Implementations

There are over fifty implementations of the Document pattern in Microsoft Dynamics NAV. The most well-known implementations are the Sales and Purchase documents.

Examples

This is a subset of the tables that use Document Pattern:

Table ID

Description

36,37

Sales Header, Sales Line

110,111

Sales Shipment Header, Sales Shipment Line

295, 296

Reminder Header, Reminder Line

5076, 5077

Segment Header, Segment Line

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset