0

I have been trying to come up with a custom validation that would check for all three cases below and return error message based on the condition that is met. These validations work separately, can someone plese help on how to make the system move on to validation 2 and then 3 and display all the messages, irrespective whether or not the previous condition was satisfied

{//VALIDATION1

{ if (this.LastDate < this.occurrence_date) 
{ return "Last Date of Occurrence must be after First Date of Occurrence"; } 

}
}
{//VALIDATION2

{ if (this.FinancialProvision > sysdate) 
{ return "Financial provision date cannot be a future date"; } 

}
}

{//VALIDATION3

{ if (this.Settlement > sysdate) 
{ return "Settlement date cannot be a future date";} 

}
}
Maxrev
  • 11
  • 2

1 Answers1

0

Why not concatenate validation string? and then return concatenated string in the end.

validation ="";

{//VALIDATION1

{ if (this.LastDate < this.occurrence_date) 
{ validation += " Last Date of Occurrence must be after First Date of Occurrence"; } 

}
}
{//VALIDATION2

{ if (this.FinancialProvision > sysdate) 
{ validation += " Financial provision date cannot be a future date"; } 

}
}

{//VALIDATION3

{ if (this.Settlement > sysdate) 
{ validation += " Settlement date cannot be a future date";} 

}
}
return validation;
Ori Marko
  • 56,308
  • 23
  • 131
  • 233