View in Applications Help

Using Application Composer, you can extend an application's object model by adding new fields to both standard or custom objects. One field type that you can add to a custom or standard object is a dynamic choice list. A dynamic choice list is a field that contains a list of values which are populated from the actual data of another object. For example, you might want to expose on a user interface page a dynamic choice list which lets users specify the account that they are logging a help request against. In this example, the Account Name choice list is a field that you are adding to the help request object, but the list of values is populated by actual names from the account object.

When creating dynamic choice lists, note the following:

  • Review the common set of field properties, as well as the dynamic choice list-specific properties, that you must specify.

  • Review the options available in the List Data Source, Additional List Display Values, and Additional List Search Fields regions.

  • Understand how a dynamic choice list results in the implicit creation of a relationship.

Note: You must create a Select and Search dialog box for a custom object, if you also create a dynamic choice list that is based on the same custom object.

Dynamic Choice List Properties

Create a dynamic choice list by specifying values for the common set of field properties, such as display label and field name. You also set properties for this field that are specific to the dynamic choice list field type.

The following table shows properties that are common across multiple field types:

Field Property

Field Property Region

Label

Appearance

Help Text

Appearance

Display Width

Appearance

Name

Name

Description

Name

Required

Constraints

Updatable

Constraints

Searchable

Note: If you plan to expose this dynamic choice list as a subtab on the related object's details page, then you must make this field searchable.

Constraints

The following table shows properties that are unique to only certain field types, including dynamic choice lists:

Field Property

Field Property Region

Related Object

List Data Source

List Selection Display Value

List Data Source

Data Filter

List Data Source

Additional List Display Values

Additional List Display Values

Additional List Search Fields

Additional List Search Fields

Using the List Data Source, Additional List Display Values, and Additional List Search Fields Regions

When defining a dynamic choice list, use the following regions to determine what data will display in the list of values at runtime.

Note: Although you can configure what data will display in the list of values at runtime, you cannot control the sequence of where those values display in the list.
  • List Data Source region

    This is a screenshot of the List Data Source region,
which you set up when you define a dynamic choice list custom field.
    • Related Object

      The values in a dynamic choice list are populated from another object's data. Select the related object first, then use the List Selection Display Value choice list to select the field that you want to display within the dynamic choice list as the first column at runtime. Selecting the related object is possible only during field creation.

      Note: The set of objects that are available for selection is constrained to top-level objects only. You cannot select a child object as a related object.

      In our example, the related object would be Account.

      Tip: Once you create a dynamic choice list field, you can easily recognize the choice list's related object from the Fields page. The Fields page displays summaries of both standard and custom fields for the selected object. If a dynamic choice list was created, then the Type column includes the related object. In our example, the field type would be Choice List (Dynamic) <Account>.
    • List Selection Display Value

      From the List Selection Display Value choice list, select the related object's field that you want to display within the dynamic choice list as the first column at runtime. This is the primary field on the related object that your users will use to make the appropriate selection. In our example, the field might be something like Name.

      Note: The fields available for selection include only the related object's required fields.
    • Data Filter

      You can further refine the set of data that appears within the dynamic choice list at runtime by using data filters. You can set up a simple filter to show only a subset of records in the list of values at runtime. Or, you can set up a more complex expression that dynamically filters the subset of records based on the object context. You can also use an existing filter that is predefined for some standard objects.

      Ideally, set data filters on a dynamic choice list during the initial configuration of the field.

      For example, use a simple filter to hide any accounts outside a particular region. Or, hide account records that are inactive. At runtime, only active accounts would appear in the dynamic choice list field.

      Tip: To optimize performance, refine the list of values displayed in this field at runtime by including one or more filters based on indexed fields.

      To learn more about data filters, see "Understanding Data Filters for Dynamic Choice Lists: Explained."

  • Additional List Display Values region

    This is a screenshot of the Additional List Display Values
region, which you set up when you define a dynamic choice list custom
field.

    You can further refine the look and feel of the dynamic choice list by selecting additional fields to display in the choice list.

    Use the Additional List Display Values region to include additional related object fields in the dynamic choice list at runtime. These additional fields assist your users in making a selection from the choice list. The region does not include the field that you already selected in the List Selection Display Value choice list.

    There is no limit on the number of additional fields that you can select.

  • Additional List Search Fields region

    This is a screenshot of the Additional List Search Fields
region, which you set up when you define a dynamic choice list custom
field.

    You can indicate which additional related object fields can be added as search criteria in the dynamic choice list's Search and Select dialog.

    Use the Additional List Search Values region to include additional related object fields in the dynamic choice list's Search and Select dialog, accessed using the Search link at runtime. The region does not include the field that you already selected in the List Selection Display Value choice list.

    There is no limit on the number of additional fields that you can select.

Implicit Relationship Creation

When you create a dynamic choice list for an object based on a related object, you are implicitly creating a one-to-many foreign key relationship where the current object is the "many" object and the related object is the "one" object. This implicit creation of a relationship lets you later add a related object subtab for the "many" object on the "one" object's details page. You can view these implicitly created choice list relationships on the Relationships page.

In the previous example of making a list of accounts available for selection for a help request, an account can be tied to multiple help requests. The relationship that is created is a one-to-many relationship between the account and help request objects, which enables users to store an account identifier in the help request object's table. In this relationship, the account object is the source object and the help request object is the target object. If a source object is ever deleted, then at runtime, then the dynamic choice list will have no values in it.

Later, you might want to expose a related object subtab on the account details page which shows, for a single account, all the help requests that are related to it. You can create this related object subtab because the relationship was already created when you created the dynamic choice list.

Note: Generally, the dynamic choice list that you create results in the implicit creation of a choice list relationship. The exception is if you are in a global single instance environment and you create a dynamic choice list between a sales and service object and a common object: resource, customer contact profile, account, address. In such cases, relationships are not implicitly created.

Groovy Script Syntax

Once a one-to-many relationship is created between objects using a dynamic choice list field, a foreign key field is created on the "many" object. Use the API names listed in the following table to access those foreign keys in your scripts.

Relationship Type

Foreign Key API Name

Pattern Used

Dynamic choice list relationship

If the dynamic choice list field name is DynChoice1_c, then the foreign key API name is DynChoice1_Id_c.

<Name of the dynamic choice list field>_Id_c

Additional Dynamic Choice List Specifications

Additional specifications for this field type include the following details:

  • Data type is VARCHAR2 (1500).

  • A object can have a total of 625 fields. Out of those 625 fields, 350 fields are reserved for text and check box fields, and fixed and dynamic choice lists.

  • Dynamic choice list fields and relationships automatically use 1 indexed number field. If all indexed number fields are already taken, then Application Composer uses a non-indexed number field.

    If a subtab or BI analysis is based off a dynamic choice list field or other relationship, then create that relationship first to ensure you obtain an indexed number field. This ensures optimal performance for your subtab or analysis.