code: public boolean onDelete()
      {
          Record record = this.getMainRecord();
          if (record == null)
              return false;
  
          if (record.getEditMode() == Constants.EDIT_NONE)
              return true;
          if (record.getEditMode() == Constants.EDIT_ADD)
          {   // If they're adding, can't delete nothing!
              this.onRefresh();
              return true;
          }
          try {
              if (record.getEditMode() != Constants.EDIT_IN_PROGRESS)
                  record.edit();
              record.remove();
              record.addNew();
              this.clearStatusText();
          } catch(DBException ex) {
              this.displayError(ex);
              return false;
          }
          return true;
      }
docs: Process the "Delete" toolbar command.
  @return  true    If command was handled