Overview of Dynamic Choice Lists
Using Application Composer, you can add 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're logging a help request against. The Account Name choice list is a field that you're 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.
You must create a Select and Search dialog box for a custom object, if you also create a dynamic choice list that's based on the same custom object. This is so that, at runtime, users can click the Search link to search for and select the value they need in the choice list field.
Using a Dynamic Choice List at Runtime
A dynamic choice list is a field that contains a list of values which are populated from the actual data of another object. At runtime, users can display the list of values, and then search for and make their selections. Let's look at an example.
Here's an example of a dynamic choice list field where users can add a salesperson to an opportunity. This is a custom field that's populated with records from the Resource object.
Notice that each dynamic choice list field includes the following:
-
A list of the most recently used records for greater efficiency.
-
A search link that, when clicked, opens the Search and Select dialog where users can search for and select a record. Again, this improves efficiency by making it easier to find the right selection.
The most recently used list displays in dynamic choice list fields based on these objects: Account, Contact, Household, Opportunity, Lead, Asset, Campaign, Partner, Service Request, Product, Product Group, and custom objects. The list includes a small set of records displayed in alphabetic order. A list of values does display for custom dynamic choice list fields based on other standard objects, but the list is sorted by the sort order defined by those objects (which could be different across objects).
In the most recently used list, records are listed if the user previously selected it in one of these ways:
-
By typing a value and tabbing out of the field
-
By typing a partial value and selecting a record from one of the auto-suggested values
-
By selecting a record from the Search and Select dialog box
-
By selecting a record from the most recently used list
For Opportunity, the dynamic choice list field displays the recently searched and selected opportunities in the Search and Select dialog, but it won't display any recently created opportunities in the most recently used list. However, for Account, the dynamic choice list displays both, the recently searched and selected, and the most recently created ones.
Any advanced filter condition set for the dynamic choice list isn't applied on the most recently used list.
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 Note:
Do not use. A field's display width is dynamically calculated based on the field type and resolution. |
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. Fields prefixed with an * are not 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.
Although you can configure what data will display in the list of values at runtime, you can't control the sequence of where those values display in the list.
-
List Data Source region
-
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 can't 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's 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 "Data Filters for Dynamic Choice Lists."
-
-
Additional List Display Values region (not available for all objects; see note below)
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 doesn't include the field that you already selected in the List Selection Display Value choice list.
There's no limit on the number of additional fields that you can select.
Note:Fields prefixed with an * are not searchable.
-
Additional List Search Fields region (not available for all objects; see note below)
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 doesn't include the field that you already selected in the List Selection Display Value choice list.
There's no limit on the number of additional fields that you can select.
The Additional List Display Values and Additional List Search Fields regions don't display when configuring a dynamic choice list that's based on one of these objects:
-
Account
-
Asset
-
Campaign
-
Contact
-
Household
-
Opportunity
-
Partner
-
Product
-
Product Group
-
Resource
-
Sales Lead
-
Service Request
That's because these objects have corresponding search and select dialog boxes that you can configure. See the related topics "Configure a Search and Select Dialog Box for Custom Objects" and "Configure a Search and Select Dialog Box for Standard Objects."
Implicit Relationship Creation
When you create a dynamic choice list for an object based on a related object, you're implicitly creating a many-to-one 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.
Let's go back to our previous example where you want to let users specify the account that they're logging a help request against. You will add an Account Name dynamic choice list field to the help request object, and its values are populated from the account object. In this example, an account can be tied to multiple help requests. The relationship that's created is a many-to-one relationship between the help request and account 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 Help Requests related object subtab on the Account details page because the relationship was already created when you created the Account dynamic choice list.
Generally, the dynamic choice list that you create results in the implicit creation of a choice list relationship. The exception is if you're in a global single instance environment and you create a dynamic choice list between an Oracle CX Sales and Fusion Service object and a common object: resource, customer contact profile, account, address. In such cases, relationships aren't implicitly created.
Groovy Script Syntax
Once a many-to-one 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.
-
For optimal performance, you can create a maximum of 20 dynamic choice lists fields for standard objects, and 19 dynamic choice lists fields for custom objects.
Note:Dynamic choice list fields can also have an impact on the performance of a page because they require additional queries to run. So, Oracle recommends that you limit the number of dynamic choice list fields exposed in landing and edit pages to 5.
-
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 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.
-
To report on custom dynamic choice list fields added to standard objects, you must create a custom subject area because you can't add custom dynamic choice list fields to prebuilt subject areas. You can then create a union report in Analytics Answers that joins the desired prebuilt subject area with your new custom subject area.
-
When a dynamic choice list field is created, a reverse accessor isn't automatically created for the field's target object. This means that, when using a REST GET call to get the target object's data, the data won't be available in the output.