Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Example validator class for custom Salesforce form validation.

/**
 * Custom form validator example.
 */
public inherited sharing class MyCustomValidator implements FuseIT_S4SCloud__FormValidator {
  /**
   * Perform custom validation.
   * @param data The parsed form object with field values.
   * @return True if the form should be processed, false to cancel.
   */
  public Boolean isValid(FuseIT_S4SCloud__FormData data) {
    // Check a submitted form value.
    Object myValue = data.getFieldValue('myCustomField');
    if (myValue instanceof String && (String)myValue == 'valid') {
      return true;
    }
    return false;
  }
}
  • No labels