RE: comparing propsal and consumption feild in form and displaying error msg
Can you please test your code? You'll see that it doesn't work, because you didn't fix the bug. You don't return false when the validation fails, because what you set to ret variable is ignored, as I explained above.
Also, are you sure you wanted to use '==' operator?
Look at the following code (and notice how indentation makes code more readable - you just mustn't forget to use Insert > Insert Code):
public boolean validate()
{
boolean ok = super();
if (prodJournalBOM.BOMProposal == prodJournalBOM.BOMConsump)
{
ok = checkFailed("Validation message");
}
return ok;
}
This is how it would look like in validateField() on table:
boolean validateField(FieldId _fieldId)
{
boolean ok = super(_fieldId);
switch (_fieldId)
{
case fieldNum(ProdJournalBOM, BOMConsump):
if (this.BOMConsump == this.BOMProposal)
{
ok = checkFailed("Validation message");
}
break;
}
return ok;
}
And this if you want to do it in validateWrite(), i.e. on saving:
boolean validateWrite()
{
boolean ok = super();
if (this.BOMProposal == this.BOMConsump)
{
ok = checkFailed("Validation message");
}
return ok;
}