General X++ Development
How do I override `validateWrite()` in a table extension?
How do I override validateWrite() in a table extension?
1 answer
Write an answerUse Chain of Command and preserve the standard validation result.
[ExtensionOf(tableStr(MyTable))]
final class MyTable_Extension
{
public boolean validateWrite()
{
boolean ret = next validateWrite();
if (ret && !this.MyRequiredField)
{
ret = checkFailed('My required field must be populated.');
}
return ret;
}
}Do not throw away the result from next validateWrite(). Your validation should add to standard validation, not replace it.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer