docs: public int refreshToCurrent(int iChangeType, boolean bWarningIfChanged)
      {
          try {
              if ((this.getEditMode() == Constants.EDIT_CURRENT)
                  || (this.getEditMode() == Constants.EDIT_IN_PROGRESS))
              {
                  Object bookmark = this.getCounterField().getData();
                  if (bookmark != null)
                  {
                      int iOldOpenMode = this.getOpenMode();
                      this.setOpenMode(Constants.OPEN_REFRESH_TO_CURRENT | (iOldOpenMode/* & Constants.LOCK_TYPE_MASK*/)); // This is only trigger server listeners for changes
                      
                      // First step - backup the current data
                      int iFieldsTypes = BaseBuffer.ALL_FIELDS;
                      BaseBuffer buffer = new VectorBuffer(null, iFieldsTypes);
                      buffer.fieldsToBuffer(this, iFieldsTypes);
  
                      boolean rgbModified[] = null;
                      if ((iChangeType != Constants.AFTER_DELETE_TYPE)
                          && (this.isModified()))
                      {
                          boolean bLockRecord = this.getEditMode() == Constants.EDIT_IN_PROGRESS;
                          // Second step, save which fields have been modified.
                          rgbModified = new boolean[this.getFieldCount()];
                          for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
                          {
                              rgbModified[iFieldSeq] = this.getField(iFieldSeq).isModified();
                          }
                          // Third step - refresh the record
                          String strOldKey = this.getKeyName();
                          this.setKeyName(Constants.PRIMARY_KEY);
                          this.getCounterField().setData(bookmark);
                          boolean bSuccess = this.getTable().seek(null);
                          this.setKeyName(strOldKey);
                          // Forth step - Move the changed fields to the refreshed record
                          if (!bSuccess)
                              this.getTable().addNew();
                          else
                          {
                              if (bLockRecord)
                                  this.getTable().edit();    // If I haven't changed any data, just refresh it.
                              buffer.resetPosition();
                              for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
                              {
                                  Object dataScreen = buffer.getNextData();
                                  if (rgbModified[iFieldSeq])
                                  {
                                      FieldInfo field = this.getField(iFieldSeq);
                                      Object dataUpdated = field.getData();
                                      if (((dataUpdated != null) && (!dataUpdated.equals(dataScreen)))
                                          || ((dataUpdated == null) && (dataScreen != dataUpdated)))
                                              field.setData(dataScreen);
                                  }
                              }
                          }
                      }
                      else
                      {
                          this.getTable().addNew();    // Clear current bookmark
                          if (iChangeType != Constants.AFTER_DELETE_TYPE)
                          {
                              String strOldKey = this.getKeyName();
                              this.setKeyName(Constants.PRIMARY_KEY);
                              this.getCounterField().setData(bookmark);
                              this.getTable().seek(null);
                              this.setKeyName(strOldKey);
                          }
                      }
                      this.setOpenMode(iOldOpenMode);
                      buffer.resetPosition();
                      for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
                      {
                          FieldInfo field = this.getField(iFieldSeq);
                          boolean bIsModified = false;
                          if (rgbModified != null)
                              if (rgbModified[iFieldSeq] == false)
                                  bIsModified = field.isModified();   // If it wasn't modified until now, flag it.
  
                          Object dataScreen = buffer.getNextData();
                          Object dataUpdated = field.getData();
                          if (((dataUpdated != null) && (!dataUpdated.equals(dataScreen)))
                              || ((dataUpdated == null) && (dataScreen != dataUpdated)))
                                  bIsModified = true;     // Changed somewhere else, better call fieldChanged just in case I read secondary or something.
                          if (bIsModified)
                          {
                              if ((this.getField(iFieldSeq).isVirtual())
                                  && (!this.getField(iFieldSeq).isModified())
                                      && (this.getField(iFieldSeq).getData() == this.getField(iFieldSeq).getDefault()))
                              {   // Virtual fields that were not changed, need to be returned to their former value
                                  this.getField(iFieldSeq).setData(dataScreen);
                                  this.getField(iFieldSeq).setModified(false);
                              }
  //                            else
  //                                this.getFieldInfo(iFieldSeq).handleFieldChanged(true, Constants.SCREEN_MOVE); // Typical
                          }
                      }
                  }
              }
          } catch (DBException ex) {
              ex.printStackTrace();
          }
          return Constants.NORMAL_RETURN;
      }