Modifying FieldClass

The property FieldClass defines how the table field can be used by the client application. Possible values of the property are explained as follows:

  • Normal: This is the usual field that contains table data. So far, we have worked only with normal fields.
  • FlowField: Aggregated field, which is calculated from other fields. The value of the FlowField is not stored in the database, but calculated by the NAV server at runtime.
  • FlowFilter: Similar to FlowField, the FlowFilter field does not exist in the SQL database. These fields are used as a part of the calculation formula for FlowFields to filter the records included in the calculation. In RTC, when you open the Limit totals to section on any page, you see the list of FlowFilters.

Now we will create a calculated field in the Lease Contract Header table to sum up the total amount in contract lines, and include a FlowFilter to enable filtering on the specific item in the contract.

Add another field to the 50500 Lease Contract Header table. Properties that should be assigned to the new field are in the next table:

Field no. Field name Data type
5 Total Amount Decimal

 

In the FieldClass field, which we have not changed so far, select the FlowField field class from the drop-down list. Since FlowFields only display the calculation result and do not store the data, they should not accept user input. To make the field not editable, change the value of the field's Editable property to No.

Add one more field to the same table, 50500 Lease Contract Header, with parameters as in the following table:

Field no. Field name Data type Length
6 Item No. Filter Code 20

 

For this field, change the FieldClass from the default Normal to FlowFilter.

Also, the field Item No. Filter must allow a lookup to the Item table, so open the field properties and set the value of the TableRelation property to Item. Configured this way, the Item No. Filter field will reference the primary key of the Item table, allowing lookups on the referenced table.

In the next step, we will configure the calculation formula for the new FlowField. This formula is going to rely on the FlowFilter Item No. Filter to specify which items should be included in the calculation. In order to set up the formula, we need to save the table design, close the designer, and reopen it again. If you attempt to set up the calculation rules right away, new fields will not be available in the formula configuration designer.

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

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