FIELDNAME Function (Record)

Gets the name of a field as a string.

Name := Record.FIELDNAME(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: Text constant or code

The name of the field specified.

Remarks

The FIELDCAPTION Function (Record) retrieves the Caption Property of a field. If you want to enable your application for multilanguage functionality now or in the future, you must use the FIELDCAPTION function instead of the FIELDNAME function.

Example

This example requires that you create the following variables.

Variable name DataType Subtype

NameOfField

Text

Not applicable

CustomerRec

Record

Customer

NameOfField := CustomerRec.FIELDNAME("No.");

The name of the field is stored in a string.

The advantage of using this statement instead of Name := 'No.'; is that using the FIELDNAME function dynamically adapts to any change to the field name made in the development system. The statement Name := 'No.'; performs a static assignment.

See Also

Reference

Record Data Type

Concepts

Multilanguage Development