AgileApps Support Wiki Pre Release

Difference between revisions of "Multi Select Picklist"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 8: Line 8:


For Multi Select Picklist fields where the labels include commas, vertical orientation is the better choice
For Multi Select Picklist fields where the labels include commas, vertical orientation is the better choice
;Considerations:
:* The value stored in the database is a comma-separated list of labels, one for each selection. So:
::* If you change the order of the values, new values may be stored differently than old ones.
::* To avoid a [[Data Truncation Error]] at runtime, make sure the field is large enough to contain all possible selections.
::* Calculate the size as the sum of the entry lengths, plus N-1 for the commas between them, where N is the number of entries.
:* Use an expression like this one to mark a single box in a [[Rule]] action:
::: <tt>IF( ISNULL(field), 'checkboxLabel', field+', checkboxLabel')</tt>
::::* If the field is empty, the label is assigned to it. If the field has a value, the checkbox label is appended to it. 
::::* The checkbox label is case-sensitive, and must match the configured value exactly.
::::* Spaces are allowed between items in the value-list (but be sure to size the field appropriately.)
:* To uncheck a box in a rule, you need one of two expressions:
::: <tt><nowiki>REPLACE(field, ', checkboxlabel', '')</nowiki></tt> - for multiple selections, or
::: <tt><nowiki>REPLACE(field, 'checkboxLabel', '')</nowiki></tt> - for a single selection
:: The expressions then need to be placed inside of a nested IF statement to see if either one applies:
::: <tt><nowiki>IF (CONTAINS(field, ', checkboxLabel'), -first replacement-,</nowiki></tt>
::::  <tt><nowiki>IF (CONTAINS(field, 'checkboxLabel'), -second replacement-, field) )</nowiki></tt>
::::* This expression does the appropriate substitutions of the label is present. Otherwise, it returns the original field.
<noinclude>
<noinclude>


[[Category:Glossary]]
[[Category:Glossary]]
</noinclude>
</noinclude>

Revision as of 23:49, 2 April 2014

Multi Select Picklists provide options in a field to make multiple selections from a list of values in a Global Picklist.

In the global picklist, although the labels for the enumerated values may contain commas, the enumerated values may not contain commas.

The orientation can be vertical or horizontal

  • When displayed vertically, each label is shown on a separate line
  • When displayed horizontally, the labels are shown on the same line, separated by commas

For Multi Select Picklist fields where the labels include commas, vertical orientation is the better choice

Considerations
  • The value stored in the database is a comma-separated list of labels, one for each selection. So:
  • If you change the order of the values, new values may be stored differently than old ones.
  • To avoid a Data Truncation Error at runtime, make sure the field is large enough to contain all possible selections.
  • Calculate the size as the sum of the entry lengths, plus N-1 for the commas between them, where N is the number of entries.
  • Use an expression like this one to mark a single box in a Rule action:
IF( ISNULL(field), 'checkboxLabel', field+', checkboxLabel')
  • If the field is empty, the label is assigned to it. If the field has a value, the checkbox label is appended to it.
  • The checkbox label is case-sensitive, and must match the configured value exactly.
  • Spaces are allowed between items in the value-list (but be sure to size the field appropriately.)
  • To uncheck a box in a rule, you need one of two expressions:
REPLACE(field, ', checkboxlabel', '') - for multiple selections, or
REPLACE(field, 'checkboxLabel', '') - for a single selection
The expressions then need to be placed inside of a nested IF statement to see if either one applies:
IF (CONTAINS(field, ', checkboxLabel'), -first replacement-,
IF (CONTAINS(field, 'checkboxLabel'), -second replacement-, field) )
  • This expression does the appropriate substitutions of the label is present. Otherwise, it returns the original field.