The problem with previous answers is that they don't take existing logic into account.
For example, if you followed Gökhan suggestion, you would make the order editable if your status is Open, even if the order is in workflow or already invoiced (and the system is configured not to allow changes to invoiced orders). That would be a bug.
An appropriate place for your logic may be PurchTable.checkUpdate(). And make sure you don't set the value to true if the standard logic returns false. For example:
boolean checkUpdate(
boolean _useWarning,
boolean _interCompanyCheck,
boolean _treatInvoicedOrderUpdateWarningAsError)
{
boolean allowEdit = next checkUpdate(_useWarning, _interCompanyCheck, _treatInvoicedOrderUpdateWarningAsError);
if (this.MyStatus == MyOrderStatus::Blocked)
{
allowEdit = false;
}
return allowEdit;
}
Gökhan, please always use Insert > Code (in the rich-formatting view) to paste source code. It'll prevent the extra spaces between lines (when you post each line as a separate paragraph), it adds kine numbering and so on.