Hey Team,
I have a table with fields "First Name","Last Name","Start date", "End date", Email.
Out of these fields "First Name","Last Name","Start date","Email" are mandatory fields.
i want to validatewrite() on both StartDate and Email
My validatewrite() method has the logic "End date" should be greater than "Start Date". My code:
public boolean validateWrite()
{
boolean ret;
ret = super();
if(this.EndDate)
{
if(this.EndDate<=this.StartDate)
{
ret = ret && checkFailed("End Date should be greater then Start Date");
}
}
I even want to validate the email address field so how can I write both the piece of code in validatewrite(). My code for email validation:
TransformationAssociates eda;
Str MatchEmailPattern =@"\b[a-zA-Z0-9._% -] @[a-zA-Z0-9.-] \.[a-zA-Z]{2,4}\b";
System.Text.RegularExpressions.Match myMatch;
myMatch = System.Text.RegularExpressions.Regex::Match(eda.Email, MatchEmailPattern);
if (myMatch.get_Success())
info(strFmt("%1 is an valid email id ", eda.Email));
else
Error(strFmt("%1 is not an valid email id ", eda.Email));
Please tell me how to validate both the fields?