I have a "Field1_" check box field inside the "Table1_" table. If Field1_ is set to yes, it must make it mandatory to fill in the "Field2_" field within the "Table2_" table. My idea was to make a Chain of Command on the "Table2_" of the "ValidateWrite" method, so that if the user tries to save without having filled in the "Field2_" an Alert comes out.
So far I've written something like this:
[ExtensionOf(tableStr(Table2_))]
final class Table2__Table_Extension
{
public boolean validateWrite(boolean _skipCreditLimitCheck)
{
boolean continueOnError = false;
boolean ret = next validateWrite();
Table1_ table1 = Table1_::find(this.ProjId);
if (table1.Field1_)
{
if (!this.Field2_)
{
if (continueOnError)
{
error("@SYS98197");
}
else
{
throw error("@SYS23020");
}
}
}
return ret;
}
}