COC for form level
1. canClose() :-
[ExtensionOf(formStr(SalesTable))]
final class BAS_CanClose_Extension
{
public boolean canClose()
{
boolean ret= next canClose();
SalesTable CurrentSalesTable = this.args().record();
if(ret)
{
SalesLine sl;
select count(RecId) from sl
where sl.SalesId==CurrentSalesTable.SalesId;
if(sl.RecId>=5)
{
ret=checkFailed(strFmt("Salesorder %1 contain %2 lines",CurrentSalesTable.SalesId,sl.SalesId));
}
}
return ret;
}
}