This field includes a validation script that compares the value provided by a user against a regular expression to determine if the email address is in an acceptable format. Within the context of the sample application, this requirement is defined in "BPR4: Enforce Email Address Format" in the Developer Guide and the implementation is described in "Data Quality Design" in the Developer Guide.
It follows this process:
- Uses a geRecord.GetValue("Email").ToString <> " " statement to retrieve the value of the Email field from the current record's GE and determine if the Email field is blank. If blank, no further validation is applied.
- If the Email value is not blank, the script defines a regular expression for an e-mail address format and matches the Email value from the record against the regular expression.
- If the Email value matches the regular expression, the value passes the validation test and the script calls oResult.Success = True.
- If the Email value does not match the regular expression, the value fails the validation test. The script calls oResult.Success = False and oResult.Message to display an error message to the user that the value entered is not a valid Email address.
- Note that the sample script also includes code to handle situations where the script fails for unexpected reasons.
The full text of the script appears below:
' DEMO VALIDATION SCRIPT FOR MOTOR LOANER VEHICLE TRACKING SYSTEM |
False] |
([A-Za-z0-9]-) |
([A-Za-z0-9]\.) |
([A-Za-z0-9]+))*[A-Za-z0-9]@((\w-+) |
(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$" |
Note: The Sample Application also contains a validation script, Customers Entity: Email Field, that performs the same function for the Customers entity.