docs: public int refreshToCurrent(int iChangeType, boolean bWarningIfChanged)
      {
          int iErrorCode = DBConstants.NORMAL_RETURN;
      	try {
  	        int iHandleType = DBConstants.BOOKMARK_HANDLE;
  	
  	        if ((this.getEditMode() == Constants.EDIT_CURRENT)
  	            || (this.getEditMode() == Constants.EDIT_IN_PROGRESS))
  	        {
  	            Object bookmark = this.getHandle(iHandleType);
  	            if (bookmark != null)
  	            {
  	                Object[] rgobjEnabledFields = this.setEnableFieldListeners(false);
  	                boolean[] rgbEnabled = this.setEnableListeners(false);
  	                int iOldOpenMode = this.getOpenMode();
  	                this.setOpenMode(DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE | (iOldOpenMode & DBConstants.LOCK_TYPE_MASK));	// Straight read - no cache (keep lock settings)
                      
                      // 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 != DBConstants.AFTER_DELETE_TYPE)
  	                    && (this.isModified()))
  	                {
                          boolean bLockRecord = this.getEditMode() == DBConstants.EDIT_IN_PROGRESS;
                          // Second step, save which fields have been modified.
                          rgbModified = this.getModified();
                          // Third step - refresh the record
                          this.addNew();
                          Record newRecord = this.setHandle(bookmark, iHandleType);
                          // Forth step - Move my changed fields to the refreshed record
                          if (newRecord == null)
                              this.addNew();
                          else
                          {
                              if (bLockRecord)
                                  this.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])
                                  {   // If I modified it
                                      BaseField field = this.getField(iFieldSeq);
                                      if ((field.isVirtual()) && (field.isModified()))
                                          continue;   // Special case - some field change modified a virtual field, leave it alone
                                      Object dataUpdated = field.getData();
                                      if (((dataUpdated != null) && (!dataUpdated.equals(dataScreen)))
                                          || ((dataUpdated == null) && (dataScreen != dataUpdated)))
                                      {   // And it is different from the current data, merge data
                                          field.mergeData(dataScreen);    // This will set field modified to true
                                          if (field.isVirtual())
                                              field.setData(dataScreen);  // This will set just modified to false
                                          if (bWarningIfChanged)
                                              iErrorCode = DBConstants.RECORD_CHANGED;
                                      }
                                  }
                              }
                          }
  	                }
  	                else
  	                {
  	                    this.addNew();    // Clear current bookmark
  	                    if (iChangeType != DBConstants.AFTER_DELETE_TYPE)
  	                        this.setHandle(bookmark, iHandleType);
  	                }
  	                this.setEnableListeners(rgbEnabled);
  	                this.setEnableFieldListeners(rgobjEnabledFields);
                      // Fifth step: If what is currently on the screen is different from the new merged data, re-call the handleFieldChanged (SCREEN_MOVE)
  	                int iDBMasterSlave = 0;
  	                if ((this.getMasterSlave() & RecordOwner.MASTER) == 0)
  	                {
                          iDBMasterSlave = this.getTable().getCurrentTable().getDatabase().getMasterSlave();
                          this.getTable().getCurrentTable().getDatabase().setMasterSlave(RecordOwner.MASTER | RecordOwner.SLAVE);
  	                }
  	                boolean bAnyChanged = this.checkAndHandleFieldChanges(buffer, rgbModified, true);
  	                if (iDBMasterSlave != 0)
  	                	this.getTable().getCurrentTable().getDatabase().setMasterSlave(iDBMasterSlave);
                      this.setOpenMode(iOldOpenMode);     // Some field listeners need to know I'm refreshing, so I wait until checkAndHandleFieldChanges is done.
                      if (bWarningIfChanged)
                          if (bAnyChanged)
                              iErrorCode = DBConstants.RECORD_CHANGED;
  	            }
  	        }
      	} catch (DBException ex) {
      		ex.printStackTrace();
      	}
  		return iErrorCode;
      }