Option buttons and drop-down lists are examples of the
enumeration property. This means, you can have a set of valid values
and you can select only one value from the set. For example, you have
four types of customers, Standard, Gold, Silver, and Bronze and you
want to indicate the customer type on each activity record.
This example creates an enumeration property, Customer level
with four values, Standard, Gold, Silver, and Bronze, and displays
the property as a drop-down list in the user interface.
- Click Properties in the Resources, Activities, Inventories section.
- Click Add New.
-
Select Activity from the Entity drop-down
list.
-
Enter Cust_level in the Property label
field.
-
Enter Customer level in the Property Name
field. Enter the name in English and in all the languages that are active in the
application.
- Select Enumeration from the Property Type drop-down list.
- Select Combobox from the GUI drop-down list.
-
Click Add in the Enumeration values
section.
The Add enumeration value dialog box appears with the
Active check box selected. If you clear the
Active check box and make a value inactive, the value is available for
selection on the page to which you add the property.
-
Enter Standard in the Enumeration Values
field and click Add.
The values you add here display in alpha-numeric order.
The application
applies an index value automatically to each enumeration value, and it is case
sensitive. The APIs reference the index value. You can add the index values manually
too. For example, if you want to use a readable value for 'customer not home', you can
use the code CNH instead of the default index value, 1 and map the code to the client
system. You cannot edit the index value after it is added. Don't use '0' (zero) or '-1'
(minus one) for index values, as they are reserved for internal use.
-
Repeat step 9 and add Gold, Silver, and Bronze.
-
Click Add on the Add New Property page.
The "Default Values", "Validation Rules", and "Visibility" fields of Visual
Form Editor only work with an enumeration property's index and not its actual value. You
cannot use the value in functions such as if, concat, or in various operators. If
feasible, you can try setting the same string for both, the value and index for the
properties you must use in the "Default Values", "Validation Rules", and "Visibility"
fields.