Export (0) Print
Expand All

FIELDNO Function (Record)

Microsoft Dynamics Nav 2009

Returns 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.

Type: Integer

The number of the field specified.

This example requires that you create the following variables.

Variable name DataType Subtype

Num

Integer

 

CustomerRec

Record

Customer

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

This statement assigns the number of the No. field in the Customer 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

 

CustomerRec

Record

Customer

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.

Community Additions

ADD
Show:
© 2014 Microsoft