Login    Sites MenuBlueStep

BlueStep Platform Support

RelateScript
Outline full outline 
Overview 
Data Types 
Operators 
Statements 
Functions 
Working with Relate Data 
Field Data 
Text Fields 
Memo Fields 
Date/Time Fields 
Number Fields 
Boolean Fields 
Single Select Fields 
Multiple Select Fields 
Signature Fields 
Document Fields 
Relationship Fields 
Biometric Fields 
Password Fields 
Accessing Forms and Fields 
Special Data and Functions 
How Formulas Work 
Related Topics 

Multiple select fields are represented using a custom data type. In some Relate Script system messages, the type will be referred to by the generic data type name, Object.  Some messages will refer to the more specific data type name, MultiSelect. A MultiSelect value is never null; however, it may be empty. This condition can be determined via its custom fields. When a MultiSelect value is cast to String it results in a comma delimited list of the names of the selected options. A MultiSelect value has two fields detailed below.  If a MultiSelect value is cast to String the result is a comma delimited list of names of the currently selected items.

 

Field/Method Name Return Value Description
numSelected Integer An Integer value containing the number of selected options. If this value is 0, then the MultiSelect has no items selected. This is a read-only field.
options OptionItem[Integer] The options field is an Array value containing the list of all possible options for this field, both active and obsolete.  It is an Array of OptionItem indexed by Integer values.  The first OptionItem is at index 0.  OptionItem is another custom type or Object type.  It is described (with example code) in the section on single select fields.
active OptionItem[Integer] The active field is an Array value containing the list of active options for this field.  The list always contains the items which are stored as active, and is not effected by setting the status of an option item via RelateScript.  It is an Array of OptionItem indexed by Integer values and is indexed the same as the options array with the obsolete and disabled options removed.
obsolete OptionItem[Integer] The obsolete field is an Array value containing the list of obsolete options for this field.  The list always contains the items which are stored as obsolete, and is not effected by setting the status of an option item via RelateScript.  It is an Array of OptionItem indexed by Integer values and is indexed the same as the options array with the active and disabled options removed.
disabled OptionItem[Integer] The disabled field is an Array value containing the list of disabled options for this field.  The list always contains the items which are stored as disabled, and is not effected by setting the status of an option item via RelateScript.  It is an Array of OptionItem indexed by Integer values and is indexed the same as the options array with the active and obsolete options removed.
selected OptionItem[Integer] The selected field is an Array value containing the list of selected options for this field.  The list always contains the currently selected values and changes as options become selected or un-selected.  It is an Array of OptionItem index by Integer values as is indexed the same as the options array with the not-selected options removed.  In other words, it is not sequential whenever some items are selected and others are not.
optionsByName OptionItem[String] The optionsByName field is an Array value containing the list of possible options that may be selected.  It is an Array of OptionItem indexed by String values.  The options are listed alphanumerically by name.  OptionItem is another custom type or Object type.  It is described (with example code) in the section on single select fields.
optionsByExport OptionItem[String] The optionsByExport field is an Array value containing the list of possible options that may be selected.  It is an Array of OptionItem indexed by String values.  The options are listed alphanumerically by export value.  Options without an export value are not included.  OptionItem is another custom type or Object type.  It is described (with example code) in the section on single select fields.
selectedNames String[Integer] The selectedNames field is an Array value containing the names of the selected options.  They are indexed by the same index as they would be found by in the options list.
selectedExportValues String[Integer] The selectedExportValues field is an Array value containing the export values of the selected options.  They are indexed by the same index as they would be found by in the options list.  If the selected item does not have an export value it will still be in the array, but the value will be null.
setSelected(String field)   Sets the selection of the current multi-select field exactly like another multi-select field using the same option list.  The function receives another multi-select field as input.  So if you have a multi-select field 'a' and another multi-select field 'b' both using a common option list, then you could make both fields have the same options selected by writing a.setSelected(b).  The result is that the options selected in field 'b' are now selected in field 'a' and options not selected in 'b' are not selected in 'a'.
lookup(String name) OptionItem The lookup function finds a single option in the list of options using the custom lookup properties of the option items.  Custom lookup properties come in two varieties: unique and non-unique.  Names beginning with an underbar do not have to be unique. Names that do not begin with an underbar must be unique name/value pair for any one type of Relate element within a single organization.  Thus, if the name begins with an underbar there could be more than one option that has the same name/value pair associated with it.  In this case, the first matching option will be returned.