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  


Type: FieldRef

Refers to the current field.

Property Value/Return Value

Type: Text

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.

Variable name DataType
ItemRecref RecordRef
MyFieldRef FieldRef
OptionString Text

MyFieldRef := ItemRecref.FIELD(19);  
OptionString := MyFieldRef.OPTIONSTRING;  
MESSAGE(' %1', OptionString);  

See Also

FieldRef Data Type