Tuesday 4 February 2014

TABLE Object

Tables Used to describe how data is stored in the database and how it is retrieved. Understanding tables is the key to using all of the other objects in C/SIDE.
The triggers in a table can be divided into two categories:
·         Table triggers
·         Field triggers
Tables have the following triggers.


Table trigger

Executes when


A new record is inserted into the table.


A record in the table is modified.


A record in the table is deleted.


A record is modified in a primary key field.
Fields have the following triggers.


Field trigger

Executes when


Data is entered in a field or when the VALIDATE Function (Record) is executed.


Lookup is activated.

Special Table Fields

In addition to the conventional data fields which hold values, three kinds of
Specialized fields are available for data retrieval:
• SumIndexFields
• FlowFields
• FlowFilter Fields

1.FlowFields

A FlowField is a virtual field that extends the table data. It is not a permanent part of the table data.
A Flowfield is a powerful feature of the Microsoft Dynamics NAV database system. It is used to calculate values from another table. The information in the FlowFields exists only at run time. The values in FlowFields are automatically initialized to zero (0).
To update a FlowField, developers use the CALCFIELDS function that has the
following syntax:
<Record>.CALCFIELDS

If a FlowField is a direct source expression of a control on a form, the FlowField is automatically calculated when the form is displayed.

2.FlowFilter
Users may want to limit calculations so that they include only those values in a column that have some specific properties. For example, the user may want to sum up only the amounts of customer entries that are entered in April. This is possible if the application is designed by using FlowFilter fields for the FlowFields.

3.SumIndexFields
A SumIndexField is a decimal field that can be attached to a key definition. This is the fundamental feature of the Microsoft Dynamics NAV database that constructs the basis for FlowFields. SumIndexFields enable fast calculation of numeric columns in tables, even in tables with thousands of records. This is because SumIndexFields are maintained when the database record is updated.
SumIndexFields enable the fast calculation such as sums of columns to be displayed by using FlowFields. For example, in a conventional database system, –à The Sales FlowField is not yet usable. For the system to calculate the Sales FlowField, a SumIndexField must be created in the Sales Transactions table with a correct key.

No comments:

Post a Comment