Gets the number assigned to a field in the table description.

Number := Record.FIELDNO(Field)

Parameters

Record

Type: Record

The name of the record that contains the field.

Field

Type: Field

The name of the field in the record.

Property Value/Return Value

Type: Integer

The number of the field specified.

Example

This example requires that you create the following variables.

Variable name DataType Subtype

Num

Integer

Not applicable

CustomerRec

Record

Customer

 Copy Code
Num := CustomerRec.FIELDNO("No.");

This statement assigns the number of the No. field in the CustomerRec record to the number variable.

In this example, the FIELDNO function is used to determine which field that a variable, which contains a field number, points to in a record. This example requires that you create the following variables.

Variable name DataType Subtype

CurrentFieldNo

Integer

Not applicable

CustomerRec

Record

Customer

 Copy Code
CASE CurrentFieldNo OF
  Customer.FIELDNO("No."): 
    ...
  Customer.FIELDNO(Name): 
    ...
  Customer.FIELDNO(Address):
    ...
  ELSE
    ...
END;

This construct allows you to take actions based on the field number contained in the CurrentFieldNo variable.

See Also