dw.web
Class FormElementValidationResult
Object
dw.web.FormElementValidationResult
Represents a form element validation result. The validation script specified for form groups and fields can create such FormElementValidationResult with the desired validity, message and data and can then return it. The server side form element validation will evaluate these settings, i.e. calculate the corresponding element validity and message. The optional data provided with this instance will be kept and can be accessed again from the form element after server side validation.
Properties
data  :  Map  (Read Only)
Provides optional data acquired during validation.
message  :  String
Provides an optional message in case of validation failure.
valid  :  boolean
States if the validation succeeded or failed.
Constructor Summary
FormElementValidationResult(valid : boolean)
Creates a FormElementValidationResult with given setting for the validity but without any message.
FormElementValidationResult(valid : boolean, message : String)
Creates a FormElementValidationResult with given setting for the validity and corresponding message.
FormElementValidationResult(valid : boolean, message : String, data : Map)
Creates a FormElementValidationResult with given setting for the validity and corresponding message.
Method Summary
addData(key : Object, value : Object) : void
Adds optional data acquired during validation.
getData() : Map
Provides optional data acquired during validation.
getMessage() : String
Provides an optional message in case of validation failure.
isValid() : boolean
States if the validation succeeded or failed.
setMessage(message : String) : void
Sets an optional message in case of validation failure.
setValid(valid : boolean) : void
Sets if the validation succeeded or failed.
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.

Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβ€”passing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβ€”this is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?

This isn't just another prep courseβ€”it's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.

The Salesforce B2C Commerce Architect certification is a whole different gameβ€”complex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Constructor Detail
FormElementValidationResult
public FormElementValidationResult(valid : boolean)
Creates a FormElementValidationResult with given setting for the validity but without any message.
Parameters:
valid - the desired validity

FormElementValidationResult
public FormElementValidationResult(valid : boolean, message : String)
Creates a FormElementValidationResult with given setting for the validity and corresponding message. This is especially useful to represent a failed validation including some error message.
Parameters:
valid - the desired validity
message - the desired message

FormElementValidationResult
public FormElementValidationResult(valid : boolean, message : String, data : Map)
Creates a FormElementValidationResult with given setting for the validity and corresponding message. This is especially useful to represent a failed validation including some error message. Additional data can be stored, too.
Parameters:
valid - the desired validity
message - the desired message
data - the desired data

Method Detail
addData
addData(key : Object, value : Object) : void
Adds optional data acquired during validation.
Parameters:
key - the key for which the data value will be stored
value - the data value that is stored for the given key

getData
getData() : Map
Provides optional data acquired during validation.
Returns:
the data acquired during validation

getMessage
getMessage() : String
Provides an optional message in case of validation failure.
Returns:
the message for validation failure

isValid
isValid() : boolean
States if the validation succeeded or failed.
Returns:
true if the validation succeeded

setMessage
setMessage(message : String) : void
Sets an optional message in case of validation failure.
Parameters:
message - the message for validation failure

setValid
setValid(valid : boolean) : void
Sets if the validation succeeded or failed.
Parameters:
valid - if the validation succeeded

β™₯
Notifications pending to read