Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
SubmitFormData Class
Namespace
Example
Use methods in the SubmitFormData class to retrieve the selected values in different form components:
1String buttonClickedId = formData.getButtonClicked();
2if (buttonClickedId == 'submitButton') {
3// Handle form submit
4} else if (buttonClickedId == 'cancelButton') {
5// Handle form cancel
6}
7
8String picklistValueOld = formData.getOldSelectedValue('myPicklist');
9String picklistValueNew = formData.getSelectedValue('myPicklist');
10if (picklistValueOld != picklistValueNew) {
11// Do something
12}
13
14List<String> checkboxValuesOld = formData.getOldSelectedValues('myCheckbox');
15List<String> checkboxValuesNew = formData.getSelectedValues('myCheckbox');
16if (checkboxValuesOld != null && checkboxValuesNew != null && (checkboxValuesOld.size() != checkboxValuesNew.size())) {
17// Do something
18}
19
20String textinputValueOld = formData.getOldStringValue('myTextinput');
21String textinputValueNew = formData.getStringValue('myTextinput');
22if (textinputValueOld != textinputValueNew) {
23// Do something
24}SubmitFormData Methods
The following are methods for SubmitFormData.
getButtonClicked()
Signature
public String getButtonClicked()
Return Value
Type: String
getOldSelectedValue(fieldId)
Signature
public String getOldSelectedValue(String fieldId)
Parameters
- fieldId: Type: String Identifies a field in the preference form.
Return Value
Type: String
getOldSelectedValues(fieldId)
Signature
public List<String> getOldSelectedValues(String fieldId)
Parameters
- fieldId: Type: String Identifies a field in the preference form.
getOldStringValue(fieldId)
Signature
public String getOldStringValue(String fieldId)
Parameters
- fieldId: Type: String Identifies a field in the preference form.
Return Value
Type: String