Picklist Field

Adding component

Virtual picklist component: Adding virtual fields to the form

Source object picklist field: Adding data source fields

Picklist view types

Along with the single list view user can display picklist as radio buttons control.

Click component on the form (1) and select view type on the left (2):

Form renderer - single list view type:

Form renderer - radio view type:

Component properties

Use Standard Field Dependencies - displays picklist options based on sObject Record Type settings and reflects Sales Force setup for field dependencies (available starting 4.1 release).

Record type dependencies

Below is SalesForce setup for "Industry" picklist on Account for record type called "Customer Account":

"Industry" picklist (3) added to the form and "Use Standard Field Dependencies" checkbox (4) is turned on:

"Industry" picklist on the form displays options based on the Record Type (5):

NOTE: Picklists with Record Type dependency will display filtered options only for forms with "Edit" mode and Data Source id passed to the form. "New" mode form will display whole set of picklist options.

To update picklist options dynamically add Record Type lookup to the Parent form, and dependent picklist to the Nested Form. Use "Refresh" action to refresh Nested Form when Record Type lookup value is updated and saved (onAfterSave form event).

Picklists dependencies

Below is setup of Day of Week multi-select picklist that depends on Month picklist.

Both fields are added to the form, "Day of Week" multi-select (6) has "Use Standard Field Dependencies" checkbox (7) turned on:

Form opened in "Edit" mode (i.e. with Data Source record id) reflects "Day of Week" (9,11) to "Month" (8,10) dependency:

When using same form in "New" mode (i.e. without Data Source record id) "Month" picklist will be editable but "Day of Week" multipicklist will be disabled if there are record types on the Data Source object (this reflects standard Sales Force behavior). If data source record doesn't have record types both "Month" and "Day of Week" picklists will be editable as picklists do not depend on record type values.

Picklist dynamic options

For situations when data need to be added to a picklist dynamically user is to use "Dynamic options" setting (12):

Options are to be passed as a semicolon separated values or JSON.

Below are examples of caseType variable setup used to store dynamic picklist options:

Passing semicolon separated options:

Above variable will store case types labels separated with semicolon. Result string will look like following:

Mechanical;Electrical;Structural;Other;Issue;Question;Idea

NOTE: When using semicolon separated values final picklist options keys will be same as options values.

Passing JSON allows one to create picklist with labels different from values.

Available starting 2.16 release.

Above setup will result JSON string storing case types as a key:value pairs where key is case type label and value is first 3 characters of the label.

Result string will look like following:

{"Mechanical":"Mec","Electrical":"Ele","Structural":"Str","Other":"Oth","Issue":"Iss","Question":"Que","Idea":"Ide"}

NOTE: JSON has to store object with "key":"value" pairs where "key" is option label and "value" is option value:
{"key":"value", "key1":"value1", ... }

To use variable as a source for dynamic picklist simply add it to "Options" input (13):

To learn more about working with variables please refer following article: Variables

Virtual picklist default value

Select one of the existing options as a default one (14):

For dynamic picklist fill default value with required option value:

User can use merged field to pass default value to picklist.

Picklist option groups

Option Groups feature provides user with an ability to show specified options in picklist component based on conditions.

Available only when "Dynamic options" setting is set to false

Standard Option Groups

Select picklist (15) on a canvas and click "Add Group" button (16) under "Option Groups" section:

Check options to be displayed in multi-select (17), add condition (18) and click "Save changes" button (20):

Above condition (19)  will be satisfied for account records with "Upsell Opportunity" = "Yes", those accounts will only have "Hot" and "Warm" options for the Account Rating on the form. All other accounts will have all three options displayed in picklist component.

User can have multiple option groups set up for a single picklist component.

Generated option groups

Starting with 3.1 release one can generate option group for the picklist based on object record type.

Below is Salesforce setup for "Industry" picklist on Account for record type called "Customer Account":

Form source in example below is set to Account.

Select picklist (21) on the form, click "Generate" button on "Options Group" section and click "Yes" button:

Option group is generated based on the record type setting:

Conditional styles

Input Picklist component has following conditional styles options:

  • hide
  • show
  • required
  • disable
  • clear

Form components conditional styling

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.