Create master tables
A master table contains information about the subject of its application area. For example, the Customer table is a master table. A master table is the subject of the sales, marketing, and receivables application areas, and it is somewhat static. Users regularly enter new master records but rarely change existing master records.
All transactional tables in an application area are related to a master table. The master table is related to many other (usually supplemental) tables.
At least one ledger table is related to a master table. Master tables frequently contain many FlowFilters and FlowFields, most of which relate to its corresponding ledger tables.
Most application areas have only one master table, though some maste tables are shared between different application areas, and some application areas occasionally have more than one master table.
Master table names
The name of a master table relates to the names of the records in the table. For example, the Customer table is named Customer because each record within it contains information about a single customer.
Primary key and other standard fields
The primary key of a master table is named No. and is of type Code with a length of 20 characters. The value of these fields is assigned automatically through the number series functionality in Business Central.
The G/L Account table is one important exception to this principle. It's the only master table in Business Central where No. isn't controlled by the number series functionality.
The description field of a master table is named Name or Description and is of type Text with a length of 100 characters. This field, together with the No. field, is always included in the DataCaptionFields property of the table so that these fields are displayed in the title bar of the table pages.
Many master tables contain a field named Blocked, which is typically of type Boolean. This field indicates whether people can use a master record in transactions. Instead of deleting a master record that is no longer used, you can mark it as blocked. This indication ensures that an attempt by any person or system action to use that master record fails.
The Blocked field isn't always of type Boolean; it can also be of type Option. For example, in Customer and Vendor tables, this field is of type Option and allows for several levels of blocking a customer or a vendor. This feature prevents the use of a master record in some specific transactions but allows for use in others.
Associated pages
At least three pages are always associated with a master table:
Card page - Use the card page to view and edit single records in the master table. The name of the page is the name of the table followed by the word card. Therefore, the card page for the Customer table is named Customer Card. In the menu bar, you'll always find a group on the card page named as the master table. This group includes actions that call pages for related or subsidiary information about the master table.
List page - Use the list page to view multiple records in the master table. Unlike the card page, you can't use the list page to edit the master table. The name of the page is the name of the table followed by the word list. Therefore, the list page for the Customer table is named Customer List. This page is set as the LookupPageID property and the DrillDownPageID property of the master table.
Like the card page, the list page also includes actions to show ledger entries and statistics with the same keyboard shortcuts. The list page has its CardPageID property set to the page ID of the corresponding card page. This setting ensures that a corresponding card is always opened when you select the View, Edit, or New actions, or when you double-click a row in a list.
Statistics page - Use the statistics page to view any calculated information about a record in the master table. This information is separated from the card page for performance reasons because this information is calculated from a potentially large number of records in the database. This information might slow down data access if it is always displayed on the card page.
The name of this page is the name of the table followed by the word statistics. Therefore, the statistics page for the Customer table is named Customer Statistics.
The following example shows a snippet of the Customer table.
table 18 Customer
{
Caption = 'Customer';
DataCaptionFields = "No.", Name;
DrillDownPageID = "Customer List";
LookupPageID = "Customer List";
fields
{
field(1; "No."; Code[20])
{
}
field(2; Name; Text[100])
{
}
...
field(39; Blocked; Option)
{
OptionMembers = " ",Ship,Invoice,All;
}
...
}
keys
{
key(Key1; "No.")
{
Clustered = true;
}
}
}