public boolean validateWrite()
{
boolean ret;
SS_CategoryTradeAgreement categoryTradeAgreement;
;
ret = super();
if(this.ToDate < this.FromDate)
ret = checkFailed("Todate should be greater than or equal to Fromdate");
while select categoryTradeAgreement where categoryTradeAgreement.Category == this.Category
{
ret = checkfailed(strfmt("Duplicate Entries are not allowed - Same record is there for Vendor - %1 with Category %2 of period %3 - %4" ,
categoryTradeAgreement.Vendor,categoryTradeAgreement.Category,categoryTradeAgreement.FromDate,categoryTradeAgreement.ToDate));
break;
}
return ret;
}