code: public Rec updateRecord(Rec record, boolean bRefresh)
      {
          try {
              Object bookmark = null;
              if (record.getEditMode() == Constant.EDIT_IN_PROGRESS)
              {
                  if (bRefresh)
                      bookmark = record.getTable().getHandle(0);
                  record.getTable().set(record);
              }
              else if ((record.getEditMode() == Constant.EDIT_ADD) && (record.isModified()))
              {
                  record.getTable().add(record);
                  if (bRefresh)
                      bookmark = record.getTable().getLastModified(0);
              }
              if (bRefresh)
                  if (bookmark != null)
                  {
                      record.getTable().setHandle(bookmark, 0);
                      record.getTable().edit();
                  }
          } catch (DBException ex) {
              ex.printStackTrace();
              if (record != null)
                  if (record.getTask() != null)
                      record.getTask().setLastError(ex.getMessage());
              return null;
          }
          return record;
      }
docs: Update this record if it has been changed
  @param record
  @return The record (or null if error)