AgileApps Support Wiki Pre Release

Enumerated Fields

From AgileApps Support Wiki
Revision as of 21:32, 23 January 2012 by imported>Aeric (→‎Create a Global Picklist)
File:Movie-rating.gif
Graphic stars illustrate movie rating

Enumerated fields provide powerful visual impact in Views, by displaying a graphic image or color-coded label in place of field values. Enumerated fields have an associated numeric value, which can be used to group, sort or filter data in Views and Reports. In Reports, enumerated fields can appear as color-coded labels, only.

These Field Display Types are enumerated:

About Enumerated Fields

Enumerated Fields in Views provide users with visual indicators of a data metrics. In this example, a movie library View is enhanced with the addition of stars to rank the movies by preference. Although the ranking (Picklist Value) is not displayed, it is used to sort the list.

File:Movie-name.gif
Sorted by Movie Name
File:Movie-rating.gif
Sorted by Movie Rating (Stars)
The ranking (with 1-4 stars) is created by adding a series of images and values to eligible Field Display Types:
Because the Picklist Value is stored in the database, it can be used in these areas of the platform:
  • Sort order in Views and Reports
  • Filters in Views and Reports
  • Color coding criteria in Views and Reports
  • Grouping criteria in Reports

Learn more: Using Enumerated Picklists with Other Platform Elements

  • Enumerated fields include these elements:
  • Display Label
    Can be either an alphanumeric string or an image, or both
  • Alphanumeric string, with optional color coding for text and background color
  • Image, optional, selected from the Documents object
  • Not used to group, sort, or filter records
  • Item Value
  • Stored as part of the record
  • Used to group, sort, or filter records
  • A number that can be used to define the display order

Working with Picklists

A Picklist is a field that can contain a list of values. It appears as a dropdown list when displayed.

Create a Picklist

  1. Click GearIcon.png > Customization > Objects > {object} > Fields
  2. Click [New Field]
  3. Provide the information in the sections below.
  4. Click [Save]
    The field is added, and the field-definition is shown.

Basic Information

Specify the basic characteristics of the field:
  • Label - The text that appears as the field name
  • Display Type - Picklist
  • Picklist Values - For a simple Picklist that returns the same values it displays, with no special colors, images, or groups for the display values, you can simply enter the values, as shown here:
EnumeratedPicklist-new.png
Otherwise, wait until the Picklist has been created, then Manage and Reorder Values.
  • Maximum Storage Length - The String length of the longest value in the list.
  • Use First Value as Default - Otherwise, the field is initially empty.
  • Sort List Alphabetically - Otherwise, you manually arrange the order.
  • Skip Value Validation - When checked there is no validation of the Enumerated Values. By default, this option is unchecked.

Notepad.png

Note: This option is available only for custom fields and not for standard fields. For standard picklists, value validation cannot be turned off.

  • Always Required - A selection must be made when adding or updating a record.
  • Field Name - Automatically created by the system (but you can change it here)

Display Attributes

Determine where the field is displayed in the default form, and whether or not the field is required when adding or updating a record.

Default Value

In general, the default value you specify will be a simple String. For example: 'rush'. But it is also possible to select functions and specify arguments, creating a formula expression that returns the default value.

Picklist DefaultValue.png
Considerations
  • The default value must resolve to the value of an entry in the list of enumerated items (not a label).
  • If the value resolves to a string which is not in the list of the enumerated items, it is as though no default were specified. Nothing is pre-selected in the Enumerated Field.
  • Field Visibility determines which roles can see or edit the field.

Description Information

Include a description of the field and its use. This information is only visible to users with rights to customize this field.


Working with Global Picklists

Create a Global Picklist

  1. Click Designer > Global Resources > Global Picklists
  2. Click the [New Global Picklist] button and enter the following information:
    • Name - The field label that will be displayed
    • Show First Value as Default - Checkbox
    • Sort List Alphabetically - Checkbox
  3. Click [Save].
    You can now proceed to Manage and Reorder the Enumerated Values, as explained below.

Add a Value

In the Enumerated Values section:

  1. Click [Manage Values].
  2. Specify the values, the text and colors and/or the image to display.
  3. Click [Save].

Reorder Values

To change the order in which picklist values are displayed:

  1. Click [Reorder Picklist Values] button.
    A list of entries appears.
  2. Select an entry and use the Up-Down Arrows to change its position in the list.
  3. Click [Save]

Notepad.png

Note: Reordering can be done only when the Sort List Alphabetically option is unchecked.

Specify a Default Value

To specify a default value for an enumerated field:

  1. Click [Edit]
  2. Type in a value or select functions to create a formula expression that returns the default value.
Considerations
  • For checkboxes, the formula must resolve to 1, 0, true, or false.
  • The default value must resolve to the value of an entry in the list of enumerated items (not a label).
  • If the value resolves to a string which is not in the list of the enumerated items, it is as though no default were specified. Nothing is pre-selected in the Enumerated Field.
  • Default values cannot be specified for a Dependent Picklist. (For all other types of Enumerated Fields, they can.)

Setting Colors and Images for Enumeration Values

For a simple list with no colors, images, or group labels, you can simply specify the values when creating the field, as in this example:

EnumeratedPicklist-new.png

Once the field is created, however, (whether or not you have specified any values), you have many additional options, as explained in Manage and Reorder Values, below.

Use Label for Grouping

File:Picklistgroupbylabel.gif
Fruit and Vegetable are group labels

Use this option to group picklist values by label. The Use Label for Grouping option is useful when a picklist is long, and can be organized into groups.

Considerations
  • The Use Label for grouping option is only available for Picklists
  • After the Use Label for grouping option is selected, the Sort List Alphabetically option is reset to NO
  • If the Use Label for grouping option is selected, the enumerated values are not available for dependent field associations

To Use Label for Grouping:

  1. Create a Picklist (or Global Picklist with Type = Enumerated)
    • Enter the values in the desired order
    • Include the labels inline with the values
    Fruitpicklist.gif
  2. In the Enumerated Values section, select the intended label
    Fruit and Vegetable are the intended group labels
    Click the Use Label for Grouping checkbox
    Picklistuselabel.gif
  3. Repeat for each intended label

Manage and Reorder Enumerated Values

The Enumerated Values section of the field-definition page, lets you specify the picklist values and the order in which they appear.

To specify which values appear:

  1. Click [Manage Values]
  2. Click the box under the Trash can to remove an item.
  3. Click [Add More Rows] to add additional items
  4. Click [Save] when done
Settings
  • Display Label - The label to display in the list.
  • Value - The actual value that is stored in a record (or returned to a program) when the item is chosen from the list. When the field is used to group, sort, or filter records, it is the value of the field that determines the outcome.

Notepad.png

Note: Alphanumeric Characters are allowed in labels and values, including special characters (+ / ' - _) and spaces.

Reorder Values

In the Enumerated Values section of the field-definition page, click [Reorder Values] to change the order in which the values appear:

Picklist ReorderValues.png

Notepad.png

Note: Reordering can be done only when the Sort List Alphabetically option is unchecked.


Additional Operations

Create a Dependent Picklist

When the possible choices depend on selections made in other fields, use a Dependent Picklist.

Using Enumerated Fields with Other Platform Elements

Because Picklist Values can contain alphanumeric characters, additional functionality becomes available, as listed here:

Sort order
Use the Picklist Value in Views and Reports to define sort order
Grouping
Use the Picklist Value to Group records in Views and Reports
Display in Views
The Display Labels are shown when displaying a record and in Views. Based on the options selected, the image and the text colors will be shown.
Color coding in Views
Criteria can be specified using Display Labels or Picklist Values; The first match is done using the Display Label, followed by the Picklist Value
Searches/Filters in Views
Criteria can be specified using Display Labels or Picklist Values; The first match is done using the Display Label, followed by the Picklist Value
Global Search
Global search will use only the Picklist Values
Display in Reports
The Display Labels are shown (no images or color coding are displayed)
Reports must not use the Group option
REST or JAVA API
The Picklist Values are returned (not the Display Label)
Dependent Picklists
Learn more: Dependent Picklist
Conditional Layouts
Layout rules will use only the Picklist Values