The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
CLASS Method (FieldRef)
Gets the value of the FieldClass Property of the field that is currently selected.
This method returns an error if no field is selected.
Class := FieldRef.CLASS
Refers to the current field.
Property Value/Return Value
The field class of the field.
The FieldRef refers to the field that you are interested in.
The CLASS method returns the class as an Option. However, you cannot assign the class to an Option variable directly. Instead, you must use the EVALUATE Method. The EVALUATE method has a variable parameter to which the value is assigned and a string parameter. You use the FORMAT method to convert the result of the FieldRef.CLASS method to Text, and then use the EVALUATE method to convert the Text to an Option.
In this example, the return value of the CLASS method is converted to Text and then converted to an Option. This example requires that you create the following variables.
The value of the OptionString property of OptionVar is Normal,FlowFilter,FlowField.
In this example, the return value of the CLASS method is converted to Text and then converted to an Option. This example uses the Field virtual table instead of an Option variable. The Field virtual table has a Class field, which is an Option and already has the correct OptionString.
This example requires that you create the following variables.