Enumerations

Last modified: February 13, 2024

1 Introduction

An enumeration defines a list of predefined values. Enumerations are used for the enumeration attribute type. For example, the status of an order can be Open, Closed, or In Progress. So, the enumeration for the order status will consist of three values: Open, Closed, and In_Progress.

An enumeration consists of one or more enumeration values. Each value represents one option. An attribute of the enumeration type can also represent an uninitialized state: for example, if you do not assign any status to an order, the order status will be empty.

2 Creating an Enumeration

To create a new enumeration, do the following:

  1. In the Project Explorer, right-click the module or a folder you want to add enumeration to and in the list of actions, select Add other > Enumeration:

  2. In the Add Enumeration dialog box, fill out the name of the enumeration.

  3. In the Enumeration dialog box, click New to create enumeration values:

    1. Fill out Name and Caption for an enumeration value. You can set Image for it if necessary. For more information on enumeration properties, see the Enumeration Properties section.

    2. Click OK to save the enumeration value.

  4. Repeat step 3 for every enumeration value that you want to create.

  5. Click OK to save the enumeration.

You have added a new enumeration to your project. You can use the same enumeration for different attributes of the enumeration type in your project.

3 Enumeration Properties

An enumeration has the following properties:

  • Name – the name of the enumeration

  • Enumeration values – an enumeration has one or more enumeration values. Each value represents one of the options. For more information on enumeration values and their properties, see the Enumeration Value Properties section.

3.1 Enumeration Value Properties

Enumeration value properties are described below:

  • Caption – the caption of an enumeration value is the text that the end-user sees for this enumeration value. This is a translatable text. For more information, see Language Menu.

  • Name – the name of an enumeration value is a technical name of the value which is used to refer to the enumeration value in your project.

  • Image – an image selected for an enumeration value can be displayed in a data grid column. In this case, the enumeration format of the column should be Image. For more information on data grid columns, see Grid Columns.

4 Read More