Newer Version Available
LoadFormData Class
Namespace
Example
Use methods in the LoadFormData class to set available and selected values in different form components:
LoadFormData Constructors
The following are constructors for LoadFormData.
LoadFormData(data)
Creates an instance of the LoadFormData class for running tests on any custom Apex classes you create for
Preference Manager.
Signature
public LoadFormData(Map<String,pref_center.FieldProperties> data)
Parameters
- data
- Type: Map<String,pref_center.FieldProperties>Map
- Maps preference form data from the field ID to the field properties.
Usage
This constructor is available in API version 56.0 and later.
LoadFormData Methods
The following are methods for LoadFormData.
addOption(fieldId, value, label)
addOption(fieldId, option)
Add a defined, selectable option for a checkbox, picklist, or radio
button field in a preference form.
Signature
public void addOption(String fieldId, System.SelectOption option)
Parameters
- fieldId
- Type: String
- Identifies a field in the preference form.
- option
- Type: System.SelectOption
- The option selected on a field in the preference form.
Return Value
Type: void
addSelectedOption(fieldId, option)
setOptions(fieldId, options)
Signature
public void setOptions(String fieldId, List<System.SelectOption> options)
Parameters
- fieldId
- Type: String
- Identifies a field in the preference form.
- options
- Type: List<System.SelectOption>
- The selectable options for a field in the preference form.
Return Value
Type: void
setSelectedOption(fieldId, optionValue)
setSelectedOptions(fieldId, options)
For an existing checkbox field on a preference form that has defined
values, set the values entered in the options field as the selected options. This requires the
field on the form to have defined options with a set value.
Signature
public void setSelectedOptions(String fieldId, List<String> options)
Parameters
Return Value
Type: void