The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
OPTIONSTRING Method (FieldRef)
Gets the list of options that are available in the field that is currently selected.
OptionString := FieldRef.OPTIONSTRING
Refers to the current field.
Property Value/Return Value
The list of options that is available in the field.
All the options for this field are returned as a comma separated string.
This method returns an error if no field is selected.
If the field is not an option an empty string is returned
The following example opens the Item table with RecordRef variable that is named ItemRecref and creates a reference to field 19 (Price/Profit Calculation), which is an Options field. The OPTIONSTRING method retrieves the options in the field and displays them as a comma separated list. This example requires that you create the following global variabless.
ItemRecref.OPEN(DATABASE::Item); MyFieldRef := ItemRecref.FIELD(19); OptionString := MyFieldRef.OPTIONSTRING; MESSAGE(' %1', OptionString);