This simple data type denotes an option value.

Remarks

In the OptionString Property of the field or variable, you can enter the option values as a comma-separated list. The Option type is a zero-based enumerator type, which means that the option values are assigned to sequential numbers, starting with 0. You can convert option data types to integers.

For more information about option variables in multilanguage-enabled applications, see Developing Multilanguage-Enabled Applications.

Example

In the Purchase Header table, the Status field is an Option data type. In the following example, the option value is converted into an integer. This example requires that you create the following variables.

Name Data type Subtype

Number

Integer

Not applicable

PurchHeaderRec

Record

Purchase Header

  Copy Code
Number := PurchHeaderRec."Document Type";

This example shows how you can use the value of an option field as a constant in your C/AL code.

  Copy Code
PurchHeaderRec."Document Type" := PurchHeaderRec."Document Type"::Invoice;