The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
FIELDNO Method (Record)
Gets the number assigned to a field in the table description.
Number := Record.FIELDNO(Field)
The name of the record that contains the field.
The name of the field in the record.
Property Value/Return Value
The number of the field specified.
This example requires that you create the following variables.
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 method 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.
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.