I have a table with two fields: FromDate
and ToDate
. I want to make sure that the ToDate
value is always later than the FromDate
value.
To do this, I want to set the ToDate
value to the FromDate
value + 1. To do this I have implemented the following code in the validateField
method of the table:
boolean ret;
ret = super(_fieldIdToCheck);
if (ret)
{
switch (_fieldIdToCheck)
{
case fieldNum(MyTable, FromDate):
this.ToDate = this.FromDate + 1;
}
}
return ret;
This implementation works well, but the value of ToDate
can be changed to a value before FromDate
. How can this be prevented?