function Delete($param) { try { $key = $param['key']; TTransaction::open('liger'); $object = new Imovel($key); $object->delete(); TTransaction::close(); $this->onReload($param); // shows the success message new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted')); } catch (Exception $e) { // shows the exception error message new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // undo all pending operations TTransaction::rollback(); } }