Create journal tables

Completed

Journal tables enable transaction entry for an application area. All transactions, whether entered by a user directly or generated from another posting routine, pass through a journal table to eventually be posted to a ledger table. Journal tables are related to many other tables including master tables, supplemental tables, subsidiary tables, and sometimes corresponding ledger tables. Because of their use in transaction entries, journal tables have more trigger codes for validating data than most other table types.

Journal table names

The name of a journal table is the name of the transaction that's being posted followed by the words journal line. For example, the table where users enter transactions to the Resource application area is named Res. Journal Line. Each record in a journal table contains one line from the corresponding journal.

Generally, the journal table is related to two corresponding supplemental tables: Journal Template and Journal Batch. These tables let users split up data entry in various ways and then set optional information that applies to the whole journal.

The names of these two tables are the same as the name of the journal table, except that they are followed by the words journal batch or journal template instead of journal line. Therefore, the two corresponding tables for the Res. Journal Line table are named Res. Journal Template and Res. Journal Batch.

Primary key and other standard fields

The primary key of a journal table consists of three fields:

  • Journal Template Name - Field that relates to the journal template table

  • Journal Batch Name - Field that relates to the journal batch table

  • Line No. - An integer field

The Description field of this table is a text field of length 100.

Associated pages

You can use a worksheet page to make entries to the journal table. The name of the page is the same as the journal table, except without the word line. Therefore, the worksheet page for the Resource Journal Line table is named Resource Journal. Occasionally, the page is named for the type of data that's entered. For example, one of the many worksheet pages that you use with the Gen. Journal Line table is named Sales Journal. None of the primary key fields are included on the page.

When the worksheet page is called, it's filtered by the Journal Template Name and Journal Batch Name fields. The AutoSplitKey property of the worksheet page automatically sets the Line No. field by incrementing the last Line No. by 10000 or by trying to split the Line No. fields of the record above and the record under the insertion of a new record.

The journal worksheet page always includes the following actions:

  • An action that looks up the card page for the master record that's used in the journal

  • An action that shows all ledger entries for the master record that's used in the journal

  • An action named Post that posts the journal into the corresponding ledger or ledgers

Usually, the journal worksheet page includes other actions that let the user perform various processing functions.

The following example shows a snippet of the Res. Journal Line table.

table 207 Res. Journal Line
{
    Caption = 'Res. Journal Line';

    fields
    {
        field(1; "Journal Template Name"; Code[10])
        {
            TableRelation = "Res. Journal Template";
        }
        field(2; "Line No."; Integer)
        {
        }
        field(3; "Entry Type"; Option)
        {
        }
        field(4; "Document No."; Code[20])
        {
        }
        field(5; "Posting Date"; Date)
        {
        }
        ...
        field(8; Description; Text[100])
        {
        }
        ...
        field(23; "Journal Batch Name"; Code[10])
        {
            TableRelation = "Res. Journal Batch".Name 
                            where("Journal Template Name" = 
                                  field("Journal Template Name"));
        }
        ...
    }
    keys
    {
        key(Key1; "Journal Template Name", "Journal Batch Name", "Line No.")
        {
            Clustered = true;
        }
    }
}